Skip to main content

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_181Friend
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:


caused by: java.lang.ClassNotFoundException:


at$ <unknow source>
at<native method>
at<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 ShanmugamFriend
Messages: 276
Registered: July 2009
Location: India
Senior Member

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: Sun Nov 29 23:49:33 GMT 2020

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

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

Back to the top