When executing JAR: Could not find main class. Program will exit. [message #147003] |
Thu, 06 April 2006 14:22  |
Eclipse User |
|
|
|
Originally posted by: the_lord.freemail.hu
I'm writting program using plugins from eclipse:
org.eclipse.core.runtime_3.1.2.jar
org.eclipse.jface_3.1.1.jar
org.eclipse.swt.win32.win32.x86_3.1.2.jar
org.eclipse.swt_3.1.0.jar
- these are added to the project (Java build path->Libraries->Add External
JARs...)
I have a project and a package in it. The main() is in
ProjectManagerWindow class which extends ApplicationWindow.
I can run it as a Java Application... it runs and its nice and sweet, but
if I want to make a standalone JAR to run the application, it doesn't find
the main() (Could not find the main class. Program will exit.) When the
JAR was made, the main class was set to ProjectManagerWindow.
I've tried to run the JAR from the command line as:
java -classpath [path to the JARs above (directory)] -jar p4.jar
Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/jface/window/ApplicationWindow
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
The question is: How can I make a well functioning JAR?
Thx
|
|
|
|
Powered by
FUDForum. Page generated in 0.12206 seconds