Unable to run libgdx on JDK 14
See original GitHub issueIssue details
Libgdx crashes when trying to run or develop on JDK 14 with the stacktrace attached below. I assume lwjgl needs to be updated.
Reproduction steps/code
Simply create a new project with latest gradle wrapper (6.3). Try running the application, observe the crash.
Version of LibGDX and/or relevant dependencies
1.9.10
Stacktrace
[LwjglApplication] Couldn't initialize audio, disabling audio
java.lang.UnsatisfiedLinkError: /tmp/libgdxtest/dd5c1a65/liblwjgl64.so: /usr/lib/jvm/java-14-openjdk/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /tmp/libgdxtest/dd5c1a65/liblwjgl64.so)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2452)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2508)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2704)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2637)
at java.base/java.lang.Runtime.load0(Runtime.java:745)
at java.base/java.lang.System.load(System.java:1871)
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 org.lwjgl.openal.AL.<clinit>(AL.java:59)
at com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio.<init>(OpenALAudio.java:72)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:90)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:71)
at com.test.DesktopLauncher.main(DesktopLauncher.java:9)
Please select the affected platforms
- Android
- iOS (robovm)
- iOS (MOE)
- HTML/GWT
- Windows
- Linux
- MacOS
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Why LibGDX build fails using jdk 14 - java - Stack Overflow
Solved It! I failed to realize LibGDX creates a gradle project and gradle currently is not compatable with java 14 so I downgraded...
Read more >LibGDX with updated JAVA Versions - Reddit
Literally just updated my project to JDK 14 today. You should look at upgrading the gradle wrapper first, but aside from that, I...
Read more >Which jre may be distributed with my libgdx game?
Both the OpenJDK and the Andoid Studio JRE that you use appear to be licensed under the GPLv2 license with the Classpath exception...
Read more >Importing & Running a Project - libGDX
Right click your desktop project -> Run as -> Run Configurations… On the right side, select Java Application: At the top left, click...
Read more >Day 2: Setting up libGDX - Kilobolt
i have this error when running the ZombieBird-desktop project. please help. Error: Could not find or load main class com.miho.zombiebird.desktop.DesktopLauncher.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve seen roughly the same error posted with an Ubuntu default JDK11 JVM, a more recent Amazon Corretto JVM, and if I remember it right there was a Fedora case as well (oh hi Torbuntu!). All mention
ld.so
, so somewhere in native code, and a linker error. I’m inclined to believe this has to do with some common but incorrect build setting when assembling OpenJDK; the JDKs can run at least some other applications. It’s absolutely possible that OpenGL is related to the error, or that some JDKs are already removing support for some features insun.misc.Unsafe
or other internal APIs marked for eventual removal. There does appear to be a difference between LWJGL2 and LWJGL3 here, and version 3 seems to include a fix for whatever it is. The switch to GLFW is my guess why that fix works.Personally, I’d push for halting support for MacOS entirely if or when OpenGL becomes unusable on that OS. Obviously iOS is a major target for mobile, via MobiVM/RoboVM, but for desktop OS targets… The game Halfway used libGDX amazingly well, and though their genre isn’t the same as most other games you could compare with, 4% of sales being to MacOS is a pretty miserable return considering 50% of all support requests came from Macs. Here’s a link to Robotality’s Halfway Post-Mortem.
Fixed by: 778c936c9cc35c20ded87c2ff95252c217831963