(SOLVED) Lwjgl to lwjgl3

Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/opengl/GLDebugMessageARBCallbackI
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:375)
	at com.jme3.system.JmeDesktopSystem.newContextLwjgl(JmeDesktopSystem.java:202)
	at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:275)
	at com.jme3.system.JmeSystem.newContext(JmeSystem.java:174)
	at com.jme3.app.LegacyApplication.start(LegacyApplication.java:488)
	at com.jme3.app.LegacyApplication.start(LegacyApplication.java:442)
	at com.jme3.app.SimpleApplication.start(SimpleApplication.java:126)
	at mygame.Main.main(Main.java:79)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.opengl.GLDebugMessageARBCallbackI
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 9 more

I tried using jme3-lwjgl3.jar
An error occurred
How do I replace LWJGL with LWJGL3?

Essentially that is it. You replace the jme3-lwjgl.jar with jme3-lwjgl3.jar. It should work, you should already see errors on compile time if you used directly something from LWJGL 2 that is not available anymore.

Are you using Ant, Gradle or Maven?

1 Like

I manually add the JAR packages that I need

How do I troubleshoot this problem?
I can’t locate the problem from the error message :smiling_face_with_tear:

We can’t see your build so we can’t debug your build.

Either paste your build file or show the complete list of jars that you have in your project.

If you are using a modern build tool like gradle or maven then the dependencies will be included automatically just by including jme-lwjgl3. If you are using a 25 year old tool like ANT then you will have to manually include all of the lwjgl3 native dependencies.

It looks a bit messy…
I have deleted jme-lwjgl

So, yeah, on a really old build tool like ANT… which is what you are using when you use that style of build… you will have to painstakingly remove all of the lwjgl2 native jars and add the right lwjgl3 native jars.

Gradle or maven would have done that automatically.


Thank you for your help .
I understand where my problem is.
:smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:
The replacement has completed successfully

1 Like