SWT run issue -XstartOnFirstThread argument [message #1747129] |
Wed, 09 November 2016 14:32 |
Eclipse User |
|
|
|
Hi everybody, I'm using eclipse to develop a java application on Mac.
My project include a SWT GUI so I have included the library, when I run the GUI on windows everything is okay, when I run it on mac I get this error:
***WARNING: Display must be created on main thread due to Cocoa restrictions.
Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Display.error(Unknown Source)
at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)
at org.eclipse.swt.widgets.Display.create(Unknown Source)
at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.getDefault(Unknown Source)
at Test.createContents(Test.java:29)
at Test.main(Test.java:19)
I have ticked use -XstartOnFirstThread when launching with SWT but seems as if eclipse doesn't recognize I'm launching the app with SWT, infact if I put this parameter in VM arguments the app works fine.
How can I solve without putting this argument there?
Thank you
|
|
|
Powered by
FUDForum. Page generated in 0.03464 seconds