问题
I've created a jar file that uses SWT for the UI. When launching the jar file from finder it would return an error saying
Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access
I finally got it to launch from Terminal using
java -XstartOnFirstThread -jar CommonDenom.jar
That's all well and good, but how do I implement the -XstartOnFirstThread
switch when launching from finder? Is there a simple way to do this through the manifest or something or do I have to package a launch script? if the latter, can someone show me how? Thanks.
来源:https://stackoverflow.com/questions/22277108/java-mac-os-how-do-i-get-xstartonfirstthread-to-implement-when-launching-from-f