|help to execute .jar in console [message #693188]
||Tue, 05 July 2011 21:27
Registered: July 2011
sorry i am peruvian my english is not very good.....|
i work in eclipse helios.
when i want to execute my .jar (full swt) in windows console, i get :
exception in threas "main" java.lang.NoclassdefFoundError:
caused by: java.lang.ClassNotFoundException:
at java.net.URLClassLoader$1.run <unknow source>
at java.security.AccessController.doPrivileged<native method>
at java.net.URLClassLoader.findClass<unknow source>
at java.lang.classLoader.loadclass<unknow source>
at sun.misc.Launcher$AppClassloader.loadClass<unknow source>
at java.lang.Classloader.loadClass<unknow source>
could not find the main class: wMenu. Program will exit
whats the problem.... thank people!!
|Re: help to execute .jar in console [message #693892 is a reply to message #693188]
||Thu, 07 July 2011 09:06
Registered: July 2009
What is the command you are using to execute?
You need to include swt.jar in the classpath.
For example: java -classpath <path to swt.jar>/swt.jar <Main class>
Another thing you can do is to use eclipse to export the project as a Runnable jar file and include the required libraries in the generated jar.
Then you can execute the jar file using java -jar <jar file>
Lakshmi P Shanmugam
Powered by FUDForum
. Page generated in 0.02067 seconds