Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the -XstartOnFirstThread VM Argument do / mean?

Tags:

java

jvm

lwjgl

jogl

I can't find documentation for the VM argument -XstartOnFirstThread. Seems necessary for me to run JOGL through LWJGL on my Mac. What does it mean? It seems to be that some process wants thread 0. Is this correct?

Please note: I have a run() method in my main class. It doesn't seem to be overriding anything and I'm not implementing runnable.

Example source code I'm running here: http://www.lwjgl.org/guide

like image 358
sparkyspider Avatar asked Jan 26 '15 11:01

sparkyspider


People also ask

What is the use of VM arguments?

VM arguments are typically values that change the behaviour of the Java Virtual Machine (JVM). For example, the -Xmx256M argument allows the Java heap to grow to 256MB. The Eclipse runtime is also configurable via many system properties which can be passed as VM arguments in the form: -DpropertyName=propertyValue.

What is for program arguments and VM arguments?

Program Argument: Program arguments are arguments that are passed to your application, which are accessible via the "args" String array parameter of your main method. VM Argument: VM arguments are environment or system argument that needed by JVM to execute the program.

What is VM arguments in Intellij?

Intellij allows you to specify two types of arguments when running a Java program: VM Options. Enables you to modify attributes of the JVM, including stack/heap memory allocation, system properties, GC flags, etc.


1 Answers

As of Java 1.7.0_u4, this option is documented in java -X on the Mac OSX platform.

The option causes the JVM to use thread 0 to start the application. Apparently this is necessary to get Mac OSX to run SWT and GWT apps properly. According to the Eclipse SWT FAQ, AWT and Swing apps use some undocumented magic to do this.

like image 169
Stephen C Avatar answered Oct 08 '22 22:10

Stephen C