[SOLVED] Lwjgl failed to locate shared library [3.7-alpha]

Giving 3.7-alpha a try, but I’m getting an exception when the app tries to open the main game window:

run:
Feb 27, 2024 1:34:06 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.7.0-alpha1
 * Branch: HEAD
 * Git Hash: d3ed914
 * Build Date: 2024-02-27
[LWJGL] Failed to load a library. Possible solutions:
	a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
	b) Add the JAR that contains the shared library to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
Feb 27, 2024 1:34:06 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.so
	at org.lwjgl.system.Library.loadSystem(Library.java:174)
	at org.lwjgl.system.Library.loadSystem(Library.java:64)
	at org.lwjgl.system.Library.<clinit>(Library.java:52)
	at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:100)
	at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:67)
	at org.lwjgl.system.Callback.<clinit>(Callback.java:40)
	at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:232)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:591)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:714)
	at java.base/java.lang.Thread.run(Thread.java:833)


Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "jME3 Main"

My project folder does contain a file named liblwjgl64.so, so maybe that is the file it actually wants?

LWJGL 2 or 3? And what is your OS?

Lwjgl 2.9.5, I believe. At least, that is what I was running on jme3.6.

Pop!_OS 22.04

Scratch that, I’m running 3.3.3. Sorry for the miscommunication.

Output with -Dorg.lwjgl.util.Debug=true:

run:
Feb 27, 2024 2:21:18 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.7.0-alpha1
 * Branch: HEAD
 * Git Hash: d3ed914
 * Build Date: 2024-02-27
[LWJGL] Version: 3.3.3+5
	 OS: Linux v6.6.6-76060606-generic
	JRE: Linux amd64 17.0.6
	JVM: OpenJDK 64-Bit Server VM v17.0.6+10 by Eclipse Adoptium
[LWJGL] Loading JNI library: lwjgl
	Module: org.lwjgl
	linux/x64/org/lwjgl/liblwjgl.so not found in java.library.path=/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
	liblwjgl.so not found in java.library.path
[LWJGL] Failed to load a library. Possible solutions:
	a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
	b) Add the JAR that contains the shared library to the classpath.
Feb 27, 2024 2:21:18 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.so
	at org.lwjgl.system.Library.loadSystem(Library.java:174)
	at org.lwjgl.system.Library.loadSystem(Library.java:64)
	at org.lwjgl.system.Library.<clinit>(Library.java:52)
	at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:100)
	at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:67)
	at org.lwjgl.system.Callback.<clinit>(Callback.java:40)
	at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:232)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:591)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:714)
	at java.base/java.lang.Thread.run(Thread.java:833)

Hello.

I’m having the same problem:

feb. 27, 2024 7:59:15 P. M. com.jme3.system.JmeDesktopSystem initialize
INFORMACIÓN: Running on jMonkeyEngine 3.7.0-alpha1
 * Branch: HEAD
 * Git Hash: d3ed914
 * Build Date: 2024-02-27
java.lang.ClassNotFoundException: org.lwjglx.debug.Log$DebugStreamFactory
	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:525)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:375)
	at org.lwjgl.system.APIUtil.getDebugStream(APIUtil.java:61)
	at org.lwjgl.system.APIUtil.<clinit>(APIUtil.java:42)
	at org.lwjgl.system.Library.<clinit>(Library.java:43)
	at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:100)
	at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:67)
	at org.lwjgl.system.Callback.<clinit>(Callback.java:40)
	at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:232)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:591)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:714)
	at java.base/java.lang.Thread.run(Thread.java:840)
[LWJGL] Version: 3.3.3+5
	 OS: Linux v6.1.0-18-amd64
	JRE: Linux amd64 17.0.10
	JVM: OpenJDK 64-Bit Server VM v17.0.10+7-Debian-1deb12u1 by Debian
[LWJGL] Loading JNI library: lwjgl
	Module: org.lwjgl
	linux/x64/org/lwjgl/liblwjgl.so not found in java.library.path=/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
	liblwjgl.so not found in java.library.path
[LWJGL] Failed to load a library. Possible solutions:
	a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
	b) Add the JAR that contains the shared library to the classpath.
feb. 27, 2024 7:59:15 P. M. com.jme3.app.LegacyApplication handleError
GRAVE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.so
	at org.lwjgl.system.Library.loadSystem(Library.java:174)
	at org.lwjgl.system.Library.loadSystem(Library.java:64)
	at org.lwjgl.system.Library.<clinit>(Library.java:52)
	at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:100)
	at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:67)
	at org.lwjgl.system.Callback.<clinit>(Callback.java:40)
	at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:232)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:591)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:714)
	at java.base/java.lang.Thread.run(Thread.java:840)


Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "jME3 Main"

Build “jMonkeyEngine v3.7.0-alpha1” does not include native lwjgl3.3.3 libraries.

You have to include them manually, choosing according to your OS:

[ EXAMPLE ]

  runtimeOnly "org.lwjgl:lwjgl:3.3.3:natives-linux"
  runtimeOnly "org.lwjgl:lwjgl-glfw:3.3.3:natives-linux"
  runtimeOnly "org.lwjgl:lwjgl-jemalloc:3.3.3:natives-linux"
  runtimeOnly "org.lwjgl:lwjgl-opengl:3.3.3:natives-linux"
  runtimeOnly "org.lwjgl:lwjgl-openal:3.3.3:natives-linux"
1 Like

Thanks, that cleared up the issue! :smiley:

Hmm, but doesn’t his require a fix to jME? End user of jME should not have to do this.

2 Likes

You’re absolutely right, I don’t know why it’s not included by default (it’s weird).

Also how did you guys tried the release? I can’t find it from Maven central. I don’t think it got published there.

1 Like

I downloaded the zip from github and manually added them to my project.

1 Like

Ah okay then, it is probably not an issue in jME then. As the Gradle config seems ok so I think it will work with Maven&Gradle.

1 Like

The 3.7.0-alpha1 release of the Engine is incomplete because the artifacts haven’t been published to the Maven Central Repository yet. That is why Maven and Gradle builds can’t access 3.7.0-alpha1 in the usual manner.

I hope and expect publication to Maven Central to occur in the next day or two. That should resolve these issues.

4 Likes

I am getting the same problem on my OS: Linux Mint on jME-3.7.0-alpha3.
However I am also getting the same on jME-3.6.1-stable.

It seems like lwjgl-native…jars are not included in the jME-lib when downloading it from github.

However, when I look at the library config in the SDK, I can see the native libs are there.