Lazer-exporter icon indicating copy to clipboard operation
Lazer-exporter copied to clipboard

Application will not launch in OpenJDK (but not Oracle JDK)

Open LordBurtz opened this issue 4 years ago • 7 comments

When I try to start the application with ´java -jar 'Lazer_exporter.jar'´ i get the error: Error: Could not find or load main class com.ringosham.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application I tried putting the .jar in the main directory (git cloned that), putting it into src/ and all src/* directories.. Sorry for the inconvenience but I dont know how to use that jar

LordBurtz avatar Feb 03 '21 08:02 LordBurtz

Please use Java 8. It will not run on anything higher. You can check you Java version by java -version

ringosham avatar Feb 03 '21 11:02 ringosham

Sorry to reopen this rather stupid question -but I cant get this to work... Command: java -jar Lazer_exporter.jar Error: Error: Could not find or load main class com.ringosham.Main java version: openjdk version "1.8.0_292" OpenJDK Runtime Environment (build 1.8.0_292-b10) OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode) archlinux-java get: java-8-openjdk

I decompiled your release 1.6 and it looks fine.. the Main class is correctly specified idk why this happens

LordBurtz avatar Sep 13 '21 17:09 LordBurtz

Sorry but I cannot reproduce your issue. Something must have gone wrong with your Java installation.

My Java version:

java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)

ringosham avatar Sep 13 '21 18:09 ringosham

I have the same problem on Manjaro

❯ java -version
openjdk version "16.0.2" 2021-07-20
OpenJDK Runtime Environment (build 16.0.2+7)
OpenJDK 64-Bit Server VM (build 16.0.2+7, mixed mode)

Other java applications (minecraft, lavalink) work just fine.

danbulant avatar Sep 13 '21 18:09 danbulant

However, using the java JRE 1.8 by oracle (not the OpenJDK version) works. Those aren't available in linux repos as they're proprietary though (and snap install doesn't work).

danbulant avatar Sep 13 '21 18:09 danbulant

Ah so this must have been Oracles fault (or maybe the team in OpenJDK). I'll see what can be done.

ringosham avatar Sep 13 '21 22:09 ringosham

It turns out that OpenJDK 8 does not include JavaFX (The graphical frontend) in its dependency (and all later versions of OpenJDK as well)

On Linux, this can be solved by installing openjfx See https://stackoverflow.com/questions/63842928/openjdk8-and-javafx-on-macos for macOS

ringosham avatar Sep 13 '21 22:09 ringosham