Hi,
Recently I have installed new versions of Eclipse for C++ and JAVA to work on different projects. During the installation of the new eclipse it also install new JAVA version (but it also keep the JAVA8 required by MicroEJ)
My problem is:
Now when MicroEJ SDK starts, the “Runtime JRE” parameter from “Window > Preferences > MicroEJ > Module Manager” is configured to “java-11-openjdk-amd64” and I can’t change it because this is the unique choice in the list, so I can’t build my MicroEJ project:
=============== [ Initialization Stage ] ===============
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.tools.ant.taskdefs.optional.TraXLiaison (file:/.............../ARM9-GNUv55_arm-scos-linux-gnueabi-1.0.0/source/tools/ant/lib/ant-1.0.0.jar) to field com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl._isNotSecureProcessing
WARNING: Please consider reporting this to the maintainers of org.apache.tools.ant.taskdefs.optional.TraXLiaison
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
=============== [ Launching SOAR ] ===============
FAIL
Could not create type soarTask due to java.lang.ClassFormatError: Class name is empty or contains illegal character in descriptor in class file com/is2t/mowana/soar/product/C
I try many things that doesn’t help:
First idea: Make sure /usr/bin/java
points to /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
$ update-alternatives --list java
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
$ sudo update-alternatives --config java
Il existe 2 choix pour l'alternative java (qui fournit /usr/bin/java).
Sélection Chemin Priorité État
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 mode automatique
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 mode manuel
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 mode manuel
$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 oct. 4 2021 /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 46 avril 4 17:10 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
→ No success
Second idea: Try to force MicroEJ SDK to use java 8 by editing MicroEJ-SDK.ini
:
-startup
plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1200.v20200508-1552
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-Declipse.p2.unsignedPolicy=allow
-Dmicroej.solid.repository=./../eclipsePackages
-Dmicroej.product.id=MicroEJ-SDK-Dist-21.11
→ No success
I also try to run MicroEJ like this:
./MicroEJ-SDK -vm /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
→ No success
I also try to set JAVA_HOME before launching MicroEJ:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
./MicroEJ-SDK
→ No success
Questions:
- Why when JAVA11 is installed, we can’t select JAVA8 in the list of “Runtime JRE” ?
- How did you get this list ? Which command / algorithm ?
- How to force usage of JAVA8 instead of JAVA11 …?
Note:
- I know that if I uninstall JAVA11, JAVA8 will appear on the list […], But this is not a solution because i need JAVA 11 to be installed for my other eclipse installations.
My configuration:
- MicroEJ SDK Version: Dist. 21.11
- OS: Ubuntu 20.04.4 LTS