Lwjgl fails to create the canvas on jme3.3.2 & jme3.4.0-beta

was trying to run this example :

on jme3.3.2, same goes for beta

& got this, i searched for LwjglCanvas class in the dependencies context cannot find it…

May 28, 2021 9:45:07 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.3.2-stable
 * Branch: HEAD
 * Git Hash: 1a05e3f
 * Build Date: 2020-04-27
May 28, 2021 9:45:07 PM com.jme3.system.JmeDesktopSystem newContextLwjgl
SEVERE: CRITICAL ERROR: Context class is missing!
Make sure jme3_lwjgl-ogl is on the classpath.
java.lang.ClassNotFoundException: com.jme3.system.lwjgl.LwjglCanvas
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.jme3.system.JmeDesktopSystem.newContextLwjgl(JmeDesktopSystem.java:196)
	at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:279)
	at com.jme3.system.JmeSystem.newContext(JmeSystem.java:159)
	at com.jme3.app.LegacyApplication.createCanvas(LegacyApplication.java:510)
	at test.JmeSwingGame.main(JmeSwingGame.java:34)

Exception in thread "main" java.lang.NullPointerException
	at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:280)
	at com.jme3.system.JmeSystem.newContext(JmeSystem.java:159)
	at com.jme3.app.LegacyApplication.createCanvas(LegacyApplication.java:510)
	at test.JmeSwingGame.main(JmeSwingGame.java:34)

Process finished with exit code 1

What version of lwjgl do you run? (hint: this will only ever work with version 2 as lwjgl3 is essentially incompatible with Swing/AWT.)

2 Likes

I didnot know these info, I fixed that yesterday by using ANT, looked-up for the class LwjglCanvas inside lwjgl3.jar & lwjgl.jar(which I don’t know what it was, but suspected it’s 2), So it should be now lwjgl:3.4.0-beta.

Thanks