"Please run the JVM with -XStartOnFirstThread" lwjgl IntelliJ

Viewed 52

I'm setting up LWJGL with IntelliJ - everything worked fine until I had to compile the template code. I have this error:

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.

I went to the edit configurations menu and did this:

What I changed it to:

This changed nothing and I'm getting the exact same error. Can someone help please?

1 Answers

See LWJGL "API docs" for static configuration class. org.lwjgl.system.Configuration<T>

static Configuration<java.lang.Boolean> GLFW_CHECK_THREAD0

use a java.util.Properties properties file for command-line arguments and flags to the JVM , you only need to reference the properties file on the basic startup command line.

The problem appears to be with Mac OS requiring a special restart of the JVM because the thread may not be the first JVM thread (process) the main method is executing the code on, so it requires restart with -XstartOnFirstThread

I'm not actually familiar (vague similarity to starting my apps with a .exe i compiled) but github has a standard restart .java program to model from for that situation. Another of that type of process.

Related