3

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.

greg-449
  • 109,219
  • 232
  • 102
  • 145
Marco Servetto
  • 684
  • 1
  • 5
  • 14
  • You can check this link - https://stackoverflow.com/questions/53675535/java-symbol-lookup-error-for-jli-initargprocessing-when-running-with-setcap-ca – Sujay Mohan Sep 20 '19 at 06:53
  • 1
    Please show the command line that is used by Eclipse: in the run configuration there is a _Show Command Line_ button for that. – howlger Sep 20 '19 at 06:56
  • Note that you have installed the RC1 version of 2019-09 (4.13). There was a RC2 and RC2a release after that - the final release is on https://download.eclipse.org/eclipse/downloads/drops4/R-4.13-201909161045/ – greg-449 Sep 20 '19 at 07:05
  • Here is the show command line output: /[..]/EclipseJava13/jdk-13/bin/java -ea --enable-preview -Dfile.encoding=UTF-8 -p /[..]/EclipseJava13/workspaceTest/TestSwitch/bin --enable-preview -m testSwitch/main.Main Of course, I tried to 'run' this exact line from the console, and... IT WORKS NO PROBLEM. somehow eclipse runs Java in an environment with different privileges – Marco Servetto Sep 22 '19 at 21:39
  • I have also reinstalled eclipse using the suggestion of greg, but there is no change at all. – Marco Servetto Sep 22 '19 at 22:08

2 Answers2

2

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.

Marco Servetto
  • 684
  • 1
  • 5
  • 14
1

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

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • A minor clarification re _"You should not need to add --release 13"_: it's actually more severe than that. You absolutely must not add **--release 13** to _Default VM Arguments_. If you do you will get the error `"Unrecognized option: --release"` in the Console window, and your Java 13 application won't run. Java 13 preview features work just fine without anything specified in _Default VM Arguments_. – skomisa Sep 22 '19 at 03:42
  • I'm very confused about this answer: from command line I need to add either --release 13 --enable-preview or -source 13 --enable-preview to make it compile. Anyway, my problem is on running it, compilation goes fine. – Marco Servetto Sep 22 '19 at 21:38
  • @MarcoServetto This answer was to say that by using the newly released Eclipse R-4.13-201909161045/, you would not need to add any 13 option, because by default that would be compatible with Java 13. Officially. Not "as a preview". But I see you have found a PATH issue. – VonC Sep 23 '19 at 06:44