Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK9 incompatibility: Error: Could not find or load main class org.jabref.JabRefMain #3054

Closed
jonasstein opened this issue Jul 28, 2017 · 8 comments

Comments

@jonasstein
Copy link

After fetching the latest jabref today (2017-07-28) it does not start anymore.

Fetch with:
wget https://builds.jabref.org/master/JabRef--master--latest.jar -O jabref.jar -o jabref_update.log

start with:

java -jar jabref.jar 
Error: Could not find or load main class org.jabref.JabRefMain

see also: #2867, but openfx is installed.

System Linux Mint 18.2
$ dpkg -l | grep jre
ii  openjdk-8-jre:amd64                          8u131-b11-2ubuntu1.16.04.2                 amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-8-jre-headless:amd64                 8u131-b11-2ubuntu1.16.04.2                 amd64        OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-9-jre:amd64                          9~b114-0ubuntu1                            amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-9-jre-headless:amd64                 9~b114-0ubuntu1                            amd64        OpenJDK Java runtime, using Hotspot JIT (headless)

$ dpkg -l | grep jfx
hi  libopenjfx-java                              8u60-b27-4                                 all          JavaFX/OpenJFX 8 - Rich client application platform for Java (Java libraries)
hi  libopenjfx-jni                               8u60-b27-4                                 amd64        JavaFX/OpenJFX 8 - Rich client application platform for Java (native libraries)
ii  openjfx                                      8u60-b27-4                                 amd64        JavaFX/OpenJFX 8 - Rich client application platform for Java
@Siedlerchr
Copy link
Member

Siedlerchr commented Jul 28, 2017

Which one of your java versions is set as default? (sudo update-alternatives --config java )

Jdk9 does not yet work with JabRef, see #2594

Edit2 :: The latest commits have only been some language files and a minor fix in the fetcher. So nothing important

@lenhard lenhard added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Jul 30, 2017
@jonasstein
Copy link
Author

Thank you, I just checked. Indeed it was JDK9, would it be possible to provide an appropriate error message?
Error: JDK9 required, see bug #2594

However I could start now with
$ /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -jar jabref.jar
Perhaps it helps other Linux Mint (*buntu) users who got here.

@tobiasdiez
Copy link
Member

I fear it is not possible to present a better error message. The error is thrown by java itself before anything one the side of Jabref is invoked. We are in a similar dead end as for the case where the JavaFX component was missing and where we were also not in the position to report a better error message.

@matthiasgeiger matthiasgeiger changed the title Error: Could not find or load main class org.jabref.JabRefMain JDK9 incompatibility: Error: Could not find or load main class org.jabref.JabRefMain Aug 3, 2017
@matthiasgeiger
Copy link
Member

duplicate of #2594

@matthiasgeiger matthiasgeiger marked this as a duplicate of #2594 Aug 3, 2017
@matthiasgeiger matthiasgeiger added status: duplicate and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Aug 3, 2017
@jonasstein
Copy link
Author

Thank you for your comment on this. Just another idea: You could provide an jabreftester.jar
which just tests if the environment is fine for jabref. #3073

@ytzemih
Copy link

ytzemih commented Apr 18, 2019

For me this problem seems to reoccur with JabRef 4.3.1 on Ubuntu 18.04:

With the OpenJDK version openjdk version "1.8.0_191" (/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java), I get

java -jar /opt/jabref/JabRef-4.3.1.jar
Error: Could not find or load main class org.jabref.JabRefMain

With the Oracle version java version "1.8.0_201" (/usr/lib/jvm/java-8-oracle/jre/bin/java), I can start JabRef as usual.

Because of other reasons, I am normally using OpenJDK, and was just playing around this morning with sudo update-alternatives --config java to find a working configuration.

Hope it won't take much to find a fix for this. Best wishes.

@tobiasdiez
Copy link
Member

@ytzemih
Copy link

ytzemih commented Apr 18, 2019

@ytzemih see JabRef/help.jabref.org#204

Great, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants