I am going through the JMonkeyEngine Hello World tutorial (jMonkeyEngine 3 Tutorial (1) - Hello SimpleApplication :: jMonkeyEngine Docs) and here is my first hurdle.
Whenever I run this code I get the following error:
Apr 17, 2022 6:42:37 AM com.jme3.system.JmeSystem checkDelegate
SEVERE: Failed to find a JmeSystem delegate!
Ensure either desktop or android jME3 jar is in the classpath.
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.jme3.system.JmeSystemDelegate.showSettingsDialog(com.jme3.system.AppSettings, boolean)" because "com.jme3.system.JmeSystem.systemDelegate" is null
at com.jme3.system.JmeSystem.showSettingsDialog(JmeSystem.java:155)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:120)
at Main.main(Main.java:8)
I run the code from the terminal (I like to work from the terminal). And, yeah, the jar file is in the classpath.
I don’t have any idea what’s wrong with the code. Maybe the compiler is ignoring the classpath or something like that, I don’t know. I just followed the tutorial. If you have any solution then please help me to troubleshoot.
UPDATE:
I was using the wrong library of JME. I was using the jme3-core library but the project requires the jme3-desktop (Note: jme3-desktop depends on jme3-core). That problem had been fixed but a new following problem had arisen.
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
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 Main.main(Main.java:8)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
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)
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 Main.main(Main.java:8)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at jdk.compiler/com.sun.tools.javac.launcher.Main.execute(Main.java:419)
at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:192)
at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:132)
The main issue had been fixed so I am marking the this post as “SOLVED”.