Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » SWT run issue -XstartOnFirstThread argument
icon9.gif  SWT run issue -XstartOnFirstThread argument [message #1747129] Wed, 09 November 2016 19:32
Francesco Falanga is currently offline Francesco FalangaFriend
Messages: 1
Registered: November 2016
Junior Member
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
Previous Topic:Many Errors in log
Next Topic:Eclipse Kepler hospot error
Goto Forum:
  


Current Time: Wed Oct 09 15:35:02 GMT 2024

Powered by FUDForum. Page generated in 0.03968 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top