libgdx/gdx-liftoff

1.12.0.2 does not start on OSX

mudlee opened this issue · 6 comments

I think something is off with these commits:

Info:

  • I use Java 21 zulu
  • Previous build works.
  • Let me know if I can help testing.
java -jar gdx-liftoff-1.12.0.4.jar 
Exception in thread "main" java.lang.IllegalStateException: GLFW may only be used on the main thread and that thread must be the first thread in the process. Please run the JVM with -XstartOnFirstThread. This check may be disabled with Configuration.GLFW_CHECK_THREAD0.
	at org.lwjgl.glfw.EventLoop.check(EventLoop.java:33)
	at org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:1078)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.initializeGlfw(Lwjgl3Application.java:88)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:138)
	at gdx.liftoff.MainKt.main(Main.kt:132)
	at gdx.liftoff.MainKt.main(Main.kt)

Indeed, I can confirm the same on my machine.
If you are really eager to use that build, then you can do as it states and instead start with:
java -jar -XstartOnFirstThread gdx-liftoff-1.12.0.4.jar
We have to hope that @tommyettinger gets some nice tool to set up his projects when building liftoff :D

Ah geez, I just saw this issue now. I'll try to investigate as best I can, and I'll place some beta jars in this issue thread if I think one may help solve this.

It looks like the first commit you linked might be the culprit -- I got the changed code from Guacamole, and I think it also could be wrong there. As far as I can tell, it's getting a property that should only have a value on Graal Native Image, or "" if it wasn't found. But then, it checks if that is empty, rather than is not -- causing it to stop execution if it isn't run on Graal, or keep going if it is on Graal. But it only should stop execution on Graal... So anyway, here's a beta JAR. I hope this works at least a little better! Or gets some useful information, at least.

gdx-liftoff-1.12.0.5-SNAPSHOT.jar.zip Agh, this won't work, let me make a new one...

gdx-liftoff-1.12.0.5-SNAPSHOT.jar.zip This one has the changes applied to Liftoff itself, not just generated LWJGL3 projects.

The snapshot you attached does work correctly :)

Great! That means a) I'll push a new fix release soon, and b) I'll go ahead and mention this in an issue on crykn's guacamole repo.

Leaving this open until I do the release.

Doing the release now. Closing.