wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes How do I run my SWT app outside Eclipse? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How do I run my SWT app outside Eclipse?" Watch "How do I run my SWT app outside Eclipse?" New topic
Author

How do I run my SWT app outside Eclipse?

Nigel Skeffington
Greenhorn

Joined: Mar 20, 2004
Posts: 7
Greetings!

I've developed an application in Eclipse using SWT. It runs fine in Eclipse by using Run->Run as->Java Application.

When I try to run the application outside of Eclipse, I use the -Djava_library_path to point to the SWT libs, but I always receive this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite

I get the same when I try to package it in a jar; I'm not even sure how to package up an SWT app in a jar. I fairly new to Eclipse and SWT so any suggestions are welcome.

Regards,
Nigel
Eric Clayberg
author
Ranch Hand

Joined: Sep 24, 2004
Posts: 63
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite

You need to make sure that the swt.jar file is included on your classpath. The swt.jar is in the <eclipse>\plugins\org.eclipse.swt.win32_3.0.0\ws\win32 directory. You also need to make sure that the SWT DLL (e.g., swt-win32-3062.dll) is on your path. The SWT DLL is in the <eclipse>\plugins\org.eclipse.swt.win32_3.0.0\os\win32\x86 directory.


Eric Clayberg
Software Engineering Manager
Google
Nigel Skeffington
Greenhorn

Joined: Mar 20, 2004
Posts: 7
Thanks Eric. BTW, your SWT Designer looks really nice. I'm going to check out the trial.

-Nigel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I run my SWT app outside Eclipse?