lwjgl 2.9.3, mini2dx on raspberry pi unsatisfied link error

I am attempting to get a mini2dx project which uses libgdx backend to run on my pi 3b.

I replaced the .so files for lwjgl and libgdxarm.so and got through a bunch of errors. I also replaced the native jar files with ones from the raspbian repo that came with liblwjgl-java, But now I am stuck with the following and am unsure how to proceed.

LwjglApplication: Couldn't initialize audio, disabling audio
java.lang.UnsatisfiedLinkError: org.lwjgl.DefaultSysImplementation.getJNIVersion()I
	at org.lwjgl.DefaultSysImplementation.getJNIVersion(Native Method)
	at org.lwjgl.Sys.<clinit>(Sys.java:120)
	at org.lwjgl.openal.AL.<clinit>(AL.java:59)
	at com.badlogic.gdx.backends.lwjgl.audio.Mini2DxOpenALAudio.<init>(Mini2DxOpenALAudio.java:94)
	at com.badlogic.gdx.backends.lwjgl.DesktopMini2DxGame.initialiseLibGDX(DesktopMini2DxGame.java:97)
	at com.badlogic.gdx.backends.lwjgl.DesktopMini2DxGame.<init>(DesktopMini2DxGame.java:90)
	at com.badlogic.gdx.backends.lwjgl.DesktopMini2DxGame.<init>(DesktopMini2DxGame.java:67)
	at leikr.desktop.DesktopLauncher.main(DesktopLauncher.java:15)
Exception in thread "LWJGL Application" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
	at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
	at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(LwjglGraphics.java:591)
	at com.badlogic.gdx.backends.lwjgl.DesktopMini2DxGame$1.run(DesktopMini2DxGame.java:119)

it makes me think that either the libgdxarm.so that I compiled is not working, or the lwjgl files that come with the raspbian repo are wrong. I’d appreciate any advice possible, as I am out of ideas to try.

My project I am trying this with is here: github.com/torbuntu/leikr

The RPi is not officially supported AFAIK.

The most recent solution i could find is this here: https://www.raspberrypi.org/forums/viewtopic.php?t=206824
He’s swapping out some graphics and sound driver related files to get it working, but i don’t know what version of LibGDX and Raspbian he’s using so maybe this doesn’t work with the lwjgl-based backend.

Also there’s this thread here: https://www.raspberrypi.org/forums/viewtopic.php?f=81&t=163604&sid=66a8d783ac58313c08c78e5e32b4c12f
The first page contains many posts from 2016 and onwards, the second page is more interesting.

Looks like you either have to bend over backwards or use an old LibGDX version with the JOGL backend.

I know it isn’t officially supported. I dont want to use jogl and a lot of those posts don’t work and are too outdated for what I’m trying.
I was just curious if this was even close to working. I’m starting to think the lwjgl that is in the raspbian repo is just messed up and not actually an arm version. In which case I need to go back to the start and try compiling it myself again.

What does file liblwjgl.so say? Is it something like liblwjgl.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5dbb547852e87aba1b74ac4c654c701bbfef1fed, stripped?
And what does nm -D liblwjgl.so | grep getJNIVersion say?
Should be ... T Java_org_lwjgl_DefaultSysImplementation_getJNIVersion.
Otherwise, try downloading the .deb package directly from: https://packages.debian.org/sid/arm64/liblwjgl-java-jni/download

@KaiHH Raspbian is only 32bit ATM, so using the Arm64 packages from the Debian repos will most probably not work.

@torbuntu Probably compiling it yourself is the best option. :slight_smile:

Cheers

Well, then: https://packages.debian.org/sid/armhf/liblwjgl-java-jni/download

The file liblwjgl.so returned the expected 32bit info. So it is the ‘right’ type.
I ran the nm -D liblwjgl.so | grep getJNIVersion and I didn’t get anything back. So I removed the pipe to grep and there is no getJNIVersion in there at all… Which is a problem.

That also explains why it is borking on calling that from my project. This means I pretty much have to compile it manually then, right?

Edit:
I found this https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893302 while trying to compile manually. Trying to grab the 8 jdk now to see if it can get me further.
I’m still wondering if the source in the repo is broken.

Edit2:
Just successfully compiled lwjgl 2.9.3 on the pi (using JDK 1.8 instead of 9, I’m dumb). And the nm -D liblwjgl.so does show the getJNIVersion is there! Now to adjust my jars and see what happens.

Edit3:
Well dang it. That’s all it took! Got the thing actually running now. Thanks for the help!! The liblwjgl.so that comes in the repo is in fact broken!!
This helped especially:

[quote]What does file liblwjgl.so say? Is it something like liblwjgl.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5dbb547852e87aba1b74ac4c654c701bbfef1fed, stripped?
And what does nm -D liblwjgl.so | grep getJNIVersion say?
Should be ... T Java_org_lwjgl_DefaultSysImplementation_getJNIVersion.
Otherwise, try downloading the .deb package directly from: https://packages.debian.org/sid/arm64/liblwjgl-java-jni/download
[/quote]