Java 13 and Eclipse behave strangely
I’m trying to use Java 13 with Eclipse on Linux.
I’m trying to create a “portable” java+eclipse folder that can be moved between machines.
I have downloaded and unzipped
Java 13 from
https://www.oracle.com/technetwork/java/javase/downloads/jdk13-downloads-5672538.html
I have installed all the parts in the Eclipse Marketplace
https://download.eclipse.org/eclipse/updates/4.13-P-builds
I have set the jdk into the jdk13 folder.
The result is that Eclipse can compile my Java13 code, however
Do not run it.
When I try to run, I get
[..] /EclipseJava13/jdk-13/bin/java: symbol lookup error: [..] /EclipseJava13/jdk-13/bin/java: undefined symbol: JLI_InitArgProcessing
I can compile and run Java13 from the command line using the command, no problem :
.. /.. /.. /jdk-13/bin/javac --release 13 --enable-preview main/Main.java
.. /.. /.. /jdk-13/bin/java --enable-preview main. Main
If I cut and paste the *.class generated by eclipse, I can run them with the command
.. /.. /.. /jdk-13/bin/java --enable-preview main. Main
No problem. As a result, Eclipse is recognizing Java 13 and compiling Java 13 code correctly.
But… When I try to run from inside Eclipse, I get the error.
I’m not sure what to do next.
Solution
Ok, I found this issue.
Eclipse itself is a Java program.
I also have Java8 on my machine
Eclipse runs with Java8.
Java8 preloads a version of the library with symbol JLI_InitArgProcessing in the environment. Therefore, when Java 13 runs in the same environment, it tries to reuse cached versions of such libraries.
If I start eclipse with Java13, that’s fine.