Open Cervator opened 5 years ago
Update: Same situation with a Java 8 on the same machine. After digging around a bit and trying the JVM flag from https://stackoverflow.com/questions/37978702/glfw-engine-and-the-main-thread-issue-intellij the flag alone didn't help but a suspicion that our splash screen might cause a non-main thread to get into rendering I tried the -noSplash
game argument as well which allowed the game to launch.
It still crashed on exit but ... that beats the former state! Especially with #415 now letting the game launch normally again. I'm going to temporarily make that flag default so resolving this issue should then undo that again and allow the working splash screen to pop up normally.
Exit crash (from a Java dump file, matches part of the snippet above):
java.lang.ExceptionInInitializerError
at org.lwjgl.glfw.GLFW.glfwShowWindow(GLFW.java:2149)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.setVisible(Lwjgl3Window.java:234)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:393)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:379)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:108)
at org.destinationsol.desktop.SolDesktop.main(SolDesktop.java:145)
Caused by: java.lang.IllegalStateException: Please run the JVM with -XstartOnFirstThread and make sure a window toolkit other than GLFW (e.g. AWT or JavaFX) is not initialized.
at org.lwjgl.glfw.EventLoop$OnScreen.<clinit>(EventLoop.java:63)
... 6 more
Edit: Adding a workaround for this when running from a distributed zip on Macs is proving weirdly difficult. It works if I do not target the embedded JRE - plain java -XstartOnFirstThread -jar libs/solDesktop.jar -noSplash
works, whereas lwjreOSX/bin/java -XstartOnFirstThread -jar libs/solDesktop.jar -noSplash
ignores the -noSplash
arg for some reason?
If we need to retain the -XstartOnFirstThread
part then I found a utility snippet we might want to consider to auto-enable that option even if initially running Java without it: http://www.java-gaming.org/topics/starting-jvm-on-mac-with-xstartonfirstthread-programmatically/37697/view.html
Way later edit: wanted to drop in http://forum.lwjgl.org/index.php?topic=6265.0 as I had it open for this topic but forgot the details ...
It seems like the recently-released libGDX 1.11.0 might help fix this issue? It adds a new gdx-lwjgl3-glfw-awt-macos
extension which may remove need for a work-around (https://libgdx.com/news/2022/05/gdx-1-11).
What you were trying to do
Update and run DS on my Macbook while out of town. Would be nice to know what happens on other OSes
What actually happened
Angry red text (see below). Some of it seems to suggest a JVM flag may be able to help, or to avoid certain other libs?
How to reproduce
Log details and game version
Computer details