Bypass -XStartOnFirstThread?

Started by orange451, March 26, 2017, 00:43:19

Previous topic - Next topic

orange451

Was wondering if there was any way to bypass -XStartOnFirstThread. It's terribly inconvenient to have to specify this to run lwjgl applications on OSX.

I totally get that when you release a finished product, you can simply create a "application" under OSX, and specify your JVM arguments there, but when developing it's quite annoying.

Kai

If you are using an IDE, then you can specify default VM arguments. In Eclipse you can do that on a per-JDK basis so that every run configuration you create that uses this JDK will have automatically the VM arguments appended to every run. In IntelliJ IDEA you can do the same on a per-runtype basis. See:
- For Eclipse: http://stackoverflow.com/questions/10639322/how-can-i-specify-the-default-jvm-arguments-for-programs-i-run-from-eclipse#answer-11300970 (the answer from Alice Young, not the one below that)
- For IntelliJ IDEA: https://www.jetbrains.com/help/idea/2017.1/changing-run-debug-configuration-defaults.html

orange451

Thanks for the response. Is a great fix for IDE-development!

However if I want to compile a quick demo for a friend, I also need to include a file to specifically call those VM functions. Which if he's on a mac he needs to go through terminal to give the sh file permissions to run. Whole thing is a huge hassle.

Cornix

There is not much the LWJGL devs can do about that. Thats how macs work.

darkyellow

Maybe write a java programming which uses Runtime.exec() to call another java class with the desired arts and it can check which is you are on at the same time.

Example jar file has main1.class and main2.class with the manifest having main1 as the class to run when running from a jar directly. Main1 can then run main2

kappa

I posted a code snippet a while back that you can use, if you want to trigger -XStartOnFirstThread programmatically (through Java code), it can be found here.

Useful if you want to just have a jar that you click to start your app on Mac's without having to manually enter the vm parameter.

orange451

Quote from: kappa on March 27, 2017, 13:43:35
I posted a code snippet a while back that you can use, if you want to trigger -XStartOnFirstThread programmatically (through Java code), it can be found here.

Useful if you want to just have a jar that you click to start your app on Mac's without having to manually enter the vm parameter.
Works fantastically. Thanks!