Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » help to execute .jar in console
help to execute .jar in console [message #693188] Wed, 06 July 2011 01:27 Go to next message
walter_riv_181 is currently offline walter_riv_181
Messages: 1
Registered: July 2011
Junior Member
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:

org/eclipse/swt/widgets/Decorations

caused by: java.lang.ClassNotFoundException:

org.eclipse.swt.widgets.Decorations


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 13:06 Go to previous message
Lakshmi Shanmugam
Messages: 274
Registered: July 2009
Location: India
Senior Member
Hi,

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
Previous Topic:Double Scale SWT
Next Topic:Paint Event triggered by Verify Event
Goto Forum:
  


Current Time: Thu Sep 18 17:48:14 GMT 2014

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

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