Hello Guest

Bypass -XStartOnFirstThread?

  • 6 Replies
  • 11540 Views
Bypass -XStartOnFirstThread?
« on: March 26, 2017, 00:43:19 »
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

Re: Bypass -XStartOnFirstThread?
« Reply #1 on: March 26, 2017, 10:56:18 »
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
« Last Edit: March 26, 2017, 10:58:30 by Kai »

Re: Bypass -XStartOnFirstThread?
« Reply #2 on: March 27, 2017, 02:54:21 »
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.

*

Offline Cornix

  • *****
  • 488
Re: Bypass -XStartOnFirstThread?
« Reply #3 on: March 27, 2017, 07:44:58 »
There is not much the LWJGL devs can do about that. Thats how macs work.

Re: Bypass -XStartOnFirstThread?
« Reply #4 on: March 27, 2017, 13:20:01 »
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

*

Offline kappa

  • *****
  • 1319
Re: Bypass -XStartOnFirstThread?
« Reply #5 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.
« Last Edit: March 27, 2017, 13:45:46 by kappa »

Re: Bypass -XStartOnFirstThread?
« Reply #6 on: March 27, 2017, 16:48:28 »
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!