Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to setup a swt source workspace( org.eclipse.swt.SWTException: Invalid thread access)
How to setup a swt source workspace [message #1220459] Wed, 11 December 2013 21:34 Go to next message
Evangelos Drikos is currently offline Evangelos DrikosFriend
Messages: 2
Registered: December 2013
Junior Member
Hi,

I've downloaded "swt-4.3-cocoa-macosx-x86_64.zip" on my mac (10.9 mavericks). When I compile one of the SWT examples (e.g. texteditor) and add the swt.jar to the project libraries the program starts without problems.

But, I'd like to compile the SWT from source and run the example. In this case the program crashes with the following error:

Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4397)
at org.eclipse.swt.SWT.error(SWT.java:4312)
at org.eclipse.swt.SWT.error(SWT.java:4283)
at org.eclipse.swt.widgets.Display.error(Display.java:1076)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:833)
at org.eclipse.swt.widgets.Display.create(Display.java:816)
at org.eclipse.swt.graphics.Device.<init>(Device.java:130)
at org.eclipse.swt.widgets.Display.<init>(Display.java:707)
at org.eclipse.swt.widgets.Display.<init>(Display.java:698)
at TextEditor.main(TextEditor.java:101)

The program also crashes even if I simply copy/paste the compiled libs and classes into my workspace.

So, the question is how to setup the swt source workspace.

thanks in advance,
evangelos
Re: How to setup a swt source workspace [message #1220682 is a reply to message #1220459] Fri, 13 December 2013 04:36 Go to previous messageGo to next message
Niraj Modi is currently offline Niraj ModiFriend
Messages: 48
Registered: November 2013
Member
Hi Evangelos,

Please refer, SWT source setup page:
http://eclipse.org/swt/git.php
Re: How to setup a swt source workspace [message #1220694 is a reply to message #1220682] Fri, 13 December 2013 07:04 Go to previous message
Evangelos Drikos is currently offline Evangelos DrikosFriend
Messages: 2
Registered: December 2013
Junior Member
Thank you Niraj,

My first trial was to clone the SWT repo and build the jar but it failed due to an error in project org.eclipse.swt. My second trial was to build a jar following the instructions I found in the SWT FAQ pages which also failed ("http://www.eclipse.org/swt/faq.php#howbuildjar").

Finally, I deleted and recreated the project changing the name from "swt" to "org.eclipse.swt". Now, Eclipse starts the TextEditor without problems and having edited a little the script "build.sh" I can build everything but the not the native library that depends on the xulrunner sdk. The first problem i faced was that the header files of the installed SDK are in a different location from where the "make_macosx.mak" expects; the file I've downloaded is "xulrunner-25.0.en-US.mac-x86_64.sdk.tar.bz2".

But, let's assume that my original question has been answered; I can compile the necessary SWT classes to run the TextEditor.

regards,
ev. drikos
Previous Topic:assertion error while setting focus on text field
Next Topic:Browser crashes JVM
Goto Forum:
  


Current Time: Tue Apr 23 09:07:57 GMT 2024

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

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

Back to the top