demoth / jake2

Quake 2 java port
GNU General Public License v2.0
59 stars 9 forks source link

Could not initialize class org.lwjgl.Sys on startup #101

Closed samoylovfp closed 1 year ago

samoylovfp commented 1 year ago

Having main at ef4583192ab4598a8772ad4ca6387adaa92fb059 checked out and running the game with JAVA_HOME=~/.jdks/openjdk-17.0.2 ./gradlew run --args "+set basedir \"$QUAKE2_BASEDIR\""

Results in

...setting mode 8:Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
        at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
        at jake2.client.render.opengl.LwjglDriver.setMode(LwjglDriver.java:207)
        at jake2.client.render.fast.Main.R_SetMode(Main.java:1030)
        at jake2.client.render.fast.Main.R_Init(Main.java:1086)
        at jake2.client.render.LwjglRenderer.Init(LwjglRenderer.java:72)
        at jake2.client.VID.LoadRefresh(VID.java:192)
        at jake2.client.VID.CheckChanges(VID.java:236)
        at jake2.client.VID.Init(VID.java:302)
        at jake2.client.CL.Init(CL.java:1572)
        at jake2.fullgame.Jake2.Init(Jake2.java:186)
        at jake2.fullgame.Jake2.main(Jake2.java:107)

I'll try to see if a different JDK helps

demoth commented 1 year ago

There is an existing problem in jake2 with passing the java.library.path to the jvm. Different jdk won't help here

demoth commented 1 year ago

This needs to be fixed in the gradle script.

Also, a nice to have is a better error message in such case