Deploy for Raspberry 4 not working

Could you perform a file test on the library liblwjgl.so and report back, please?

You might also have issues with your driver or the OpenGL specification. But we need to exclude common scenarios first.

On the project directory from the least “./gradlew run” setup I executed the terminal command

find . -name '*.so' -type f

There seems to be no “.so” file in the project directory tree on the Raspberry.

I checked the OpenGL version before starting this post with

glxinfo | grep "OpenGL version"

the result was

OpenGL version string: 3.1 Mesa 23.2.1-1~bpo12+rpt3

this seems to be the latest version the “apt update/upgrade” can draw onto the Raspberry.

1 Like

I think there must be one somewhere, though, or you’d have gotten a very different error. Maybe somewhere under the home directory?

Edit: actually, I also seem to remember some thread where it was talked about that this gets expanded into a temp directory maybe… it would be on the library path, though.

1 Like

Yes, it’s a folder in the tmp directory.

Example:

/tmp/lwjglpavl-x86-machine/3.3.1-build-7/liblwjgl.so

On the root directory of my Raspberry I executed

sudo find . -name '*lwjgl*.so' -type f &>> /home/pi/find.log

the result in “find.log” was

find: ‘./run/user/1000/gvfs’: Keine Berechtigung
find: ‘./run/user/1000/doc’: Keine Berechtigung

Why “sudo” command has no accces to this two directories I don’t know, but all the other directories including “tmp” seems to have no “.so” file including “lwjgl” in its name.

Any other suggestions for a search? A search with

sudo find . -name '*lib*.so' -type f &>> /home/pi/find.log

has hundrets of hits.

1 Like

Ok, but what’s the knowledge from this?

Should there be a “liblwjgl.so” somewhere?
Should it be generated/installed by “./gradlew run”?
Must it be generated/installed seperately?
Whats the “apt-install package” that’s missing?

Googling for “raspberry installing lwjgl” give no clear hint.

liblwjgl.so is a shared object file managed by the Light Weight Java Game Library team (not jMonkeyEngine). The Lwjgl framework binaries are essentially shipped on two Jars, one Jar shipping pre-compiled Java binaries which is platform independent, and the other Jar shipping pre-compiled native platform-specific binaries (i.e., the liblwjgl.so, the one you have issues with).

In order to run the native functions shipped on the liblwjgl.so, you have to link/load the library with the libjvm.so using the Operating System loader (designated as System.load(...) in Java). jMonkeyEngine has a file extractor and a native library loader that wraps API for this functionality. The JME Native library loader has a variety of options to extract the library to, afaik it could extract it to the tmp, your home in a .cache folder, or in a hashed directory… I cannot remember exactly what were the triggering events that makes the program move in each one of them, it’s really frustrating when you are not the original developer of something.

As for the problems, it seems that the liblwjgl.so is already extracted and loaded by your application, as your application didn’t fall into an Unsatisfied Link error, but an error is generated from Lwjgl itself, however I want to make sure that the jMonkeyEngine Native library loader is functioning correctly and not extracting a file from other systems. I will try to search you a way to enable logging on the Native library loader, so we would know for sure where are the extracted libraries.

The Gradle Run command has a couple of Gradle tasks to execute, some of those are devoted to dependencies’ resolution from remote repositories (such as, maven-central), and what it entails is basically downloading the aforementioned Lwjgl Jar files on a cache directory for the Gradle build tool to link them on runtime. Extraction process begins on runtime by the NativeLibraryLoader, a part of JME.

1 Like

Ok, thanks for the explanations.

Executing

sudo find . -name '*.so' -type f

on “/tmp” has not a single hit.

Executing the same on “/home” gives

./pi/.gradle/native/jansi/1.18/linux64/libjansi.so
./pi/.gradle/native/jansi/1.14/linux64/libjansi.so
./pi/.gradle/native/e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392/linux-aarch64/libnative-platform-file-events.so
./pi/.gradle/native/38dada09dfb8b06ba9b0570ebf7e218e3eb74d4ef43ca46872605cf95ebc2f47/linux-aarch64/libnative-platform-file-events.so
./pi/.gradle/native/c067742578af261105cb4f569cf0c3c89f3d7b1fecec35dd04571415982c5e48/linux-aarch64-ncurses5/libnative-platform-curses.so
./pi/.gradle/native/c067742578af261105cb4f569cf0c3c89f3d7b1fecec35dd04571415982c5e48/linux-aarch64/libnative-platform.so
./pi/.gradle/native/c067742578af261105cb4f569cf0c3c89f3d7b1fecec35dd04571415982c5e48/linux-aarch64-ncurses6/libnative-platform-curses.so
./pi/.gradle/native/68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82/linux-aarch64-ncurses5/libnative-platform-curses.so
./pi/.gradle/native/68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82/linux-aarch64/libnative-platform.so
./pi/.gradle/native/68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82/linux-aarch64-ncurses6/libnative-platform-curses.so
./pi/.mozilla/firefox/tslh82vi.default-release/gmp-gmpopenh264/2.3.2/libgmpopenh264.so

No “*.so” file looks somehow near “lwjgl”.

I found https://github.com/LWJGL/lwjgl3-wiki/wiki/1.2.-Install#extracting-the-natives-optional
That means there is a jar package somewhere with the file?

1 Like

So far JME uses its own NativeLibraryLoader; because it should be compatible with libbulletjme and lwjgl-2, as well.

There are a couple of ways to do this, the NativeLibraryLoader uses the FINE level for logging, when the Java default is INFO.

You could simply add these runtime args to your Gradle build:

run {
    // JVM arguments (passed to the JVM)
    jvmArgs = ['-Djava.util.logging.ConsoleHandler.level=FINE']
}

Or change the logging level for the default console handler via:

Logger appLogger = Logger.getLogger("");
appLogger.getHandlers().foreach(handler -> {
       handler.setLevel(Level.FINE); // enable logging for fine logs
});

I added this block in the “build.gradle” file:

run {
    // JVM arguments (passed to the JVM)
    jvmArgs = ['-Djava.util.logging.ConsoleHandler.level=FINE']
}

And I added this block in the “HelloJME3” class at both methods (“main” and “simpleInitApp”):

Logger appLogger = Logger.getLogger("");
        for (Handler handler : appLogger.getHandlers()) {
               handler.setLevel(Level.FINE); // enable logging for fine logs
        }

the console output at running “./gradlew run” stays the same:

> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes

> Task :run
Linux
aarch64
OpenJDK 64-Bit Server VM
Sept. 08, 2024 7:59:10 AM com.jme3.system.JmeSystemDelegate lambda$new$1
WARNUNG: JmeDialogsFactory implementation not found.
Sept. 08, 2024 7:59:11 AM com.jme3.system.JmeDesktopSystem initialize
INFORMATION: Running on jMonkeyEngine 3.6.1-stable
 * Branch: HEAD
 * Git Hash: 4de10c3
 * Build Date: 2023-06-23
Sept. 08, 2024 7:59:12 AM com.jme3.app.LegacyApplication handleError
SCHWERWIEGEND: GLX: Failed to create context: GLXBadFBConfig
java.lang.Exception: GLX: Failed to create context: GLXBadFBConfig
	at com.jme3.system.lwjgl.LwjglWindow$1.invoke(LwjglWindow.java:235)
	at org.lwjgl.glfw.GLFWErrorCallbackI.callback(GLFWErrorCallbackI.java:43)
	at org.lwjgl.system.JNI.invokePPPP(Native Method)
	at org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:2058)
	at org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:2229)
	at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:300)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:588)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:710)
	at java.base/java.lang.Thread.run(Thread.java:840)

Sept. 08, 2024 7:59:12 AM com.jme3.system.JmeSystemDelegate lambda$new$0
WARNUNG: JmeDialogsFactory implementation not found.
GLX: Failed to create context: GLXBadFBConfig
Exception: GLX: Failed to create context: GLXBadFBConfig
Sept. 08, 2024 7:59:12 AM com.jme3.app.LegacyApplication handleError
SCHWERWIEGEND: Failed to create display
java.lang.RuntimeException: Failed to create the GLFW window
	at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:302)
	at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:588)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:710)
	at java.base/java.lang.Thread.run(Thread.java:840)

Sept. 08, 2024 7:59:12 AM com.jme3.system.JmeSystemDelegate lambda$new$0
WARNUNG: JmeDialogsFactory implementation not found.
Failed to create display
RuntimeException: Failed to create the GLFW window
Sept. 08, 2024 7:59:12 AM com.jme3.system.lwjgl.LwjglWindow run
SCHWERWIEGEND: Display initialization failed. Cannot continue.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 8s
2 actionable tasks: 2 executed

I even tried to set the jvmargs at the gradle deamon directly with

./gradlew --stop
./gradlew -Djava.util.logging.ConsoleHandler.level=FINE wrapper
./gradlew run

but with the same result.

FYI: I think if you run gradle with the -d option then it will (among a ton of other verbose things) show if it’s actually passing that property to the real java call.

./gradlew -d run

Thanks for the hint to debug the debugger :stuck_out_tongue:

The first “info” line contains the “-Djava.util.logging.ConsoleHandler.level=FINE” argument. It looks correct. (gradle warned me to post not the complete log due to security information leaks)

...

2024-09-08T11:13:42.054+0200 [DEBUG] [org.gradle.api.internal.tasks.execution.TaskExecution] Executing actions for task ':run'.
2024-09-08T11:13:42.063+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Resolve files of :runtimeClasspath' completed
2024-09-08T11:13:42.064+0200 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command '/usr/lib/jvm/java-17-openjdk-arm64/bin/java''. Working directory: /home/pi/TestGame3 Command: /usr/lib/jvm/java-17-openjdk-arm64/bin/java -Djava.util.logging.ConsoleHandler.level=FINE -Dfile.encoding=UTF-8 -Duser.country=DE -Duser.language=de -Duser.variant -cp /home/pi/TestGame3/build/classes/java/main:/home/pi/TestGame3/build/resources/main:/home/pi/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-lwjgl3/3.6.1-stable/deef87277aa4127826741d9c64c413870949a75c/jme3-lwjgl3-3.6.1-stable.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-desktop/3.6.1-stable/a09230b60616779b1f4d8bc2ebf42ddd736c276a/jme3-desktop-3.6.1-stable.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-core/3.6.1-stable/8ebbe54ee193cfe301b625769311e41b61d1def4/jme3-core-3.6.1-stable.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.2/bc49e64bae0f7ff103a312ee8074a34c4eb034c7/lwjgl-glfw-3.3.2-natives-linux-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.2/757920418805fb90bfebb3d46b1d9e7669fca2eb/lwjgl-glfw-3.3.2.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.2/1251e3cb7e5d6159334cfb9244f789ce992f03b/lwjgl-glfw-3.3.2-natives-windows.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.2/17e1f9ec031ef72c2f7825c38eeb3a79c4d8bb17/lwjgl-glfw-3.3.2-natives-windows-x86.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.2/766bb0e8e829598b1c8052fd8173c62af741c52/lwjgl-glfw-3.3.2-natives-linux.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.2/5907d9a6b7c44fb0612a63bb1cff5992588f65be/lwjgl-glfw-3.3.2-natives-linux-arm32.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.2/8223ba1b757c43624f03b09ab9d9228c7f6db001/lwjgl-glfw-3.3.2-natives-macos.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.2/7e35644de1bf324ca9b7d52acd6e0b8d9a6da4ad/lwjgl-glfw-3.3.2-natives-macos-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.2/5249f18a9ae20ea86c5816bc3107a888ce7a17d2/lwjgl-jemalloc-3.3.2-natives-linux-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.2/877e17e39ebcd58a9c956dc3b5b777813de0873a/lwjgl-jemalloc-3.3.2.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.2/db886c1f9e313c3fa2a25543b99ccd250d3f9fb5/lwjgl-jemalloc-3.3.2-natives-windows.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.2/9b07558f81a5d54dfaeb861bab3ccc86bb4477c9/lwjgl-jemalloc-3.3.2-natives-windows-x86.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.2/2bc33176cdfabf34a63df154b80914e8f433316b/lwjgl-jemalloc-3.3.2-natives-linux.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.2/9367437ce192e4d6f5725d53d85520644c0b0d6f/lwjgl-jemalloc-3.3.2-natives-linux-arm32.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.2/959ea96ea27cd1ee45943123140fdb55c49e961f/lwjgl-jemalloc-3.3.2-natives-macos.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.2/fe75e1cad7ac1f7af4a071c4b83e39d11b65a1cc/lwjgl-jemalloc-3.3.2-natives-macos-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.2/22408980cc579709feaf9acb807992d3ebcf693f/lwjgl-openal-3.3.2-natives-linux-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.2/ae5357ed6d934546d3533993ea84c0cfb75eed95/lwjgl-openal-3.3.2.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.2/e74f299a602192faaf14b917632e4cbbb493c940/lwjgl-openal-3.3.2-natives-windows.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.2/21fcb44d32ccf101017ec939fc740197677557d5/lwjgl-openal-3.3.2-natives-windows-x86.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.2/650981780b8bbfb3ce43657b22ec8e77bfb1f37a/lwjgl-openal-3.3.2-natives-linux.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.2/7c82bbc33ef49ee4094b216c940db564b2998224/lwjgl-openal-3.3.2-natives-linux-arm32.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.2/56fa16d15039142634e3a6d97d638b56679be821/lwjgl-openal-3.3.2-natives-macos.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.2/7b43d16069bdabc9ca0923ec8756a51c5d61cb75/lwjgl-openal-3.3.2-natives-macos-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.2/bb9eb56da6d1d549d6a767218e675e36bc568eb9/lwjgl-opengl-3.3.2-natives-linux-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.2/ee8e95be0b438602038bc1f02dc5e3d011b1b216/lwjgl-opengl-3.3.2.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.2/83cd34469d4e0bc335bf74c7f62206530a9480bf/lwjgl-opengl-3.3.2-natives-windows.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.2/22fa4149159154b24f6c1bd46a342d4958a9fba1/lwjgl-opengl-3.3.2-natives-windows-x86.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.2/b8368430ef0d91a5acbc6fbfa47b20c3ec083aec/lwjgl-opengl-3.3.2-natives-linux.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.2/821f9a2d1d583c44893f42b96f6977682b48a99b/lwjgl-opengl-3.3.2-natives-linux-arm32.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.2/5141389ca737369f317b1288a570534c40db9cf/lwjgl-opengl-3.3.2-natives-macos.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.2/baadfd67936dcd7e0334dd3a9cf8dd13a0bcb009/lwjgl-opengl-3.3.2-natives-macos-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opencl/3.3.2/25cefb263d7da6d3328aab9db41b6d1ea256a134/lwjgl-opencl-3.3.2.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.2/8bd89332c90a90e6bc4aa997a25c05b7db02c90a/lwjgl-3.3.2-natives-linux-arm64.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.2/4421d94af68e35dcaa31737a6fc59136a1e61b94/lwjgl-3.3.2.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.2/a55169ced70ffcd15f2162daf4a9c968578f6cd5/lwjgl-3.3.2-natives-windows.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.2/ed495259b2c8f068794da0ffedfa7ae7c130b3c5/lwjgl-3.3.2-natives-windows-x86.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.2/767684973f259d97e7dc66a125eb153986f177e7/lwjgl-3.3.2-natives-linux.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.2/afcbfaaa46f217e98a6da4208550f71de1f2a225/lwjgl-3.3.2-natives-linux-arm32.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.2/3256dce7fa36d6b572afa5e5730f532cf987f3bf/lwjgl-3.3.2-natives-macos.jar:/home/pi/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.2/319eea74a8829ce92fd54ce7c684b6b6557c05bb/lwjgl-3.3.2-natives-macos-arm64.jar jme3test.helloworld.HelloJME3
2024-09-08T11:13:42.065+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
2024-09-08T11:13:42.068+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command '/usr/lib/jvm/java-17-openjdk-arm64/bin/java'.
2024-09-08T11:13:42.083+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
2024-09-08T11:13:42.083+0200 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
2024-09-08T11:13:42.084+0200 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command '/usr/lib/jvm/java-17-openjdk-arm64/bin/java''

...