java13 and Eclipse strange behaviour

658 views Asked by At

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

Eclipse from https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/S-4.13RC1-201908281800/eclipse-SDK-4.13RC1-linux-gtk-x86_64.tar.gz

and inside the eclipse market place I have installed all the parts of https://download.eclipse.org/eclipse/updates/4.13-P-builds

I have set the jdk to the jdk13 folder. The result is that Eclipse can compile my Java13 code, but 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 command line no problem using commands:

../../../jdk-13/bin/javac --release 13 --enable-preview main/Main.java
../../../jdk-13/bin/java --enable-preview main.Main

If I cut-paste the *.class generated by eclipse I can run them using command

../../../jdk-13/bin/java --enable-preview main.Main

no problem. Thus Eclipse is recognizing Java 13 and is correctly compiling Java 13 code.

But... when I try to run from inside Eclipse, I get that error. I'm not sure what to do next.

2

There are 2 answers

3
VonC On

You should not need to add --release 13 with "Java 13 Support for Eclipse 2019-09"

It refers to Eclipse R-4.13-201909161045/, which does have official Java support

The release notably includes the following Java 13 features:

See "Wiki Java13/Examples".

https://wiki.eclipse.org/images/9/9b/FileAddJ13.png

0
Marco Servetto On

Ok, I have discovered the issue. Eclipse itself is a Java program. On my machine I also had Java8 eclipse was running using Java8. Java8 was pre-loading a version of the library containing symbol JLI_InitArgProcessing in the environment. Thus when Java 13 was run in the same environment it was trying to reuse the cached version of such library. If I start eclipse using Java13, then there is no problem.