Skip to main content



      Home
Home » Newcomers » Newcomers » When executing JAR: Could not find main class. Program will exit.
When executing JAR: Could not find main class. Program will exit. [message #147003] Thu, 06 April 2006 14:22 Go to next message
Eclipse UserFriend
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
Re: When executing JAR: Could not find main class. Program will exit. [message #147154 is a reply to message #147003] Fri, 07 April 2006 02:23 Go to previous message
Eclipse UserFriend
Check out your project java compiler.
If you don't set a false jvm, then the classes can't be compiled.

"N
Previous Topic:Can I create an eclipse plugin with Swing?
Next Topic:sharing the jvm between many users
Goto Forum:
  


Current Time: Sun Jul 13 21:25:36 EDT 2025

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

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

Back to the top