jMonkeyEngine / jmonkeyengine

A complete 3-D game development suite written in Java.
http://jmonkeyengine.org
BSD 3-Clause "New" or "Revised" License
3.75k stars 1.12k forks source link

UnsatisfiedLinkError: libjawt.so: version `SUNWprivate_1.1' not found (lwjgl2) #1215

Closed vushu closed 1 year ago

vushu commented 4 years ago

when trying to run using java 13 this error occurs:

INFO: Running on jMonkeyEngine 3.3-alpha5
 * Branch: HEAD
 * Git Hash: bb32b88
 * Build Date: 2019-09-25
Exception in thread "jME3 Main" java.lang.UnsatisfiedLinkError: /home/vushu/coding/java/jmonkey/magicman/liblwjgl64.so: /home/vushu/.sdkman/candidates/java/13.0.1-open/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/vushu/coding/java/jmonkey/magicman/liblwjgl64.so)
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2440)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2497)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
        at java.base/java.lang.Runtime.load0(Runtime.java:744)
        at java.base/java.lang.System.load(System.java:1873)
        at org.lwjgl.Sys$1.run(Sys.java:70)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
        at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
        at org.lwjgl.Sys.loadLibrary(Sys.java:87)
        at org.lwjgl.Sys.<clinit>(Sys.java:117)
        at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:210)
        at java.base/java.lang.Thread.run(Thread.java:830)
vushu commented 4 years ago

a work around is to use 13.0.1-zulu instead of open the java 13 openjdk

stephengold commented 4 years ago

Does it also occur with earlier JDKs, such as java11 JDKs?

vushu commented 4 years ago

I just tested the earlier version and It works fine using openjdk 12 and 11

Ali-RS commented 4 years ago

Does this also happen with LWJGL3?

Ali-RS commented 4 years ago

Had a chance to test this with OpenJDK 13, using LWJGL 2 I am getting the same error but works fine with LWJGL 3.

I am closing this as this seems to be an LWJGL 2 compatibility issue which is not actively maintained anymore by the developer.

Feel free to reopen this in case you think otherwise.

Ali-RS commented 1 year ago

I can confirm using the natives provided in https://github.com/libgdx/libgdx/commit/778c936c9cc35c20ded87c2ff95252c217831963 resolves this issue.

It also seems to fix this issue https://github.com/jMonkeyEngine/jmonkeyengine/issues/1887 (I have never run into that issue before so I can not be 100% sure)

@MeFisto94 I noticed you have an updated fork of lwjgl2, are you willing to add these natives to your fork and ship it to maven (we can also migrate your fork to JME github and upload artifacts manually to maven using sonatype Staging Upload) and update JME to use it?

stephengold commented 1 year ago

Oracle's Java SE 13 reached end of support in March 2020. Does the issue also occur with Java 17?

Ali-RS commented 1 year ago

Yes, I can reproduce that issue with OpenJDK 17.

Ali-RS commented 1 year ago

I found out the 2.9.4 version @MeFisto94 has released on his fork also does work fine with newer JDKs and I do not get libjawt.so: version 'SUNWprivate_1.1' not found error. That is great!

We now need to confirm if it also works fine against this issue https://github.com/jMonkeyEngine/jmonkeyengine/issues/1247

MeFisto94 commented 1 year ago

This should be #1247 as well (i.e. the missing version just crashed at the assertion on older versions instead of showing this nice error).

@MeFisto94 I noticed you have an updated fork of lwjgl2, are you willing to add these natives to your fork and ship it to maven (we can also migrate your fork to JME github and upload artifacts manually to maven using sonatype Staging Upload) and update JME to use it?

Tbh I was not even aware I managed to build it properly, or I think I wasn't sure about the jars (never just replaced the natives), so it may need testing of all corner cases. Either way, it should probably be hosted at the jme organization, so everyone could try to fix it (in case there are more problems).

Ali-RS commented 1 year ago

Fixed in https://github.com/jMonkeyEngine/jmonkeyengine/commit/3e1b823bdb7c7a2e60916dab32186141b3fd9800