Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLFW.glfwInit() and -XstartOnFirstThread #10

Closed
Protoxy22 opened this issue Jun 12, 2022 · 2 comments
Closed

GLFW.glfwInit() and -XstartOnFirstThread #10

Protoxy22 opened this issue Jun 12, 2022 · 2 comments

Comments

@Protoxy22
Copy link

Protoxy22 commented Jun 12, 2022

Hello, I wanted to make a new test on my macbook arm64.
I built PhysX with jni natives and it went good.

But I can't run the demo, even with the argument/VM option "-XstartOnFirstThread" on Intellij, it crash at start:

I really carefully check if the VM options was valid, and it if it is interpreted at the launch.
Executing task ' run -XstartOnFirstThread'

It is really strange, does it launch for you on a macos ?

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:1046)
	at de.fabmax.kool.DesktopImpl.<clinit>(JvmPlatform.kt:62)
	at de.fabmax.kool.JvmPlatformKt.createContext(JvmPlatform.kt:28)
	at de.fabmax.kool.demo.MainKt.main(Main.kt:18)
	at de.fabmax.kool.demo.MainKt.main(Main.kt)
Caused by: 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.<clinit>(EventLoop.java:30)
	... 5 more
Caused by: 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.

Thank you in advance, I really liked the demo update of the island =)

EDIT: SOLVED
I added jvmArgs("-XstartOnFirstThread") in the gradle run task

@Protoxy22
Copy link
Author

I solved it:
I added jvmArgs("-XstartOnFirstThread") in the gradle run task

@fabmax
Copy link
Collaborator

fabmax commented Jun 13, 2022

Hmm still a bit odd that this only occurs on arm64 / macos. But good to know there's an easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants