LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: tlf30 on January 16, 2012, 07:17:46

Title: [SOLVED] java.lang.NoClassDefFoundError: Could not initialize class...
Post by: tlf30 on January 16, 2012, 07:17:46
I tried the new nightly release and this is the error, my code worked correctly in 2.8.2.


Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
at org.lwjgl.opengl.GLContext.<clinit>(GLContext.java:112)
at org.lwjgl.opengl.GL11.glMatrixMode(GL11.java:2051)

This happens when calling:


GL11.glMatrixMode(GL11.GL_PROJECTION);
Title: Re: java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
Post by: Matzon on January 16, 2012, 12:50:49
try running with org.lwjgl.util.Debug = true

failing that - we need more info, somewhere the "Could not initialize class org.lwjgl.Sys" should be spit out. or even better attach a debugger and see why it is not working.
Title: Re: java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
Post by: tlf30 on January 17, 2012, 05:06:59
This is all I get out of the debugger in netbeans: (could not find org.lwjgl.util.Debug)


Listening on javadebug
User program running
User program finished


This is the error message:


Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
at org.lwjgl.opengl.GLContext.<clinit>(GLContext.java:112)
at org.lwjgl.opengl.GL11.glMatrixMode(GL11.java:2051)
at akclient.AKClient.renderINIT1(AKClient.java:317)
at akclient.AKClient.main(AKClient.java:264)
Java Result: 1


This is the renderINIT1:


   private static void renderINIT1() {
       GL11.glMatrixMode(GL11.GL_PROJECTION);
       GL11.glLoadIdentity();
       GL11.glOrtho(0, 800, 600, 0, 1, -1);
       GL11.glMatrixMode(GL11.GL_MODELVIEW);
       GL11.glShadeModel(GL11.GL_SMOOTH);
   }


This is the statment causing the error:

GL11.glMatrixMode(GL11.GL_PROJECTION);


Also if you can tell me where the glLightfv method is that would be greate.
Title: Re: [BUG] java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
Post by: tlf30 on January 18, 2012, 04:10:33
Found the problem, I was not using the natives in the nightly release. :)
Title: Re: [BUG] java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
Post by: tlf30 on January 18, 2012, 04:11:26
This thread is now closed