New to eclipse and SWT [message #524199] |
Wed, 31 March 2010 07:06 |
David Messages: 1 Registered: March 2010 |
Junior Member |
|
|
I recently downloaded SWT and a Gui builder that uses it in eclipse. I created my program and Gui, tested and everything works fine while i am in eclipse.
Unfortunately i need to turn a working copy into my professor, and the source code will not compile properly. It looks like the java compiler does not find the SWT package that i downloaded.
I have tried using -cp and pointing it to the SWT.jar in the org.eclipse.SWT project folder in my eclipse workspace. i also have to tell the compiler where the source files are. after doing this it compiles without any errors. but when you go to run the class file it crashes saying:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Composite
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: LinkList. Program will exit.
Is there something i am missing on the install part of SWT in eclipse? or is there something special you have to do to get the program to run outside of eclipse?
any help is appreciated.
EDIT: after messing around in eclipse i exported my project to an executable .jar file and it ran. I am still not sure why the java compiler outside of eclipse wont work...
[Updated on: Wed, 31 March 2010 17:04] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03824 seconds