Results 1 to 3 of 3
- 09-10-2009, 12:16 AM #1
Member
- Join Date
- Sep 2009
- Posts
- 5
- Rep Power
- 0
Running Jar File - NoClassDefFoundError
Hi all,
This error has been annoying me for a while and has stopped me from running any and all jar files I create or found, but is mostly annoying as I can't create my own nor run them.
My code works fine in Eclipse, running is smooth, nothing bad happens or explodes. Though if I Export -> Runnable Jar File, the Jar doesn't do anything but complain:
I've done endless searches on Google for this so I know it has something to do with a ClassPath variable that either the project or the computer will hold, but no idea what to set it to or how.Java Code:Macbook:Desktop tanner$ java ./Find\ Music\ on\ Bigg\ HDD.jar Exception in thread "main" java.lang.NoClassDefFoundError: //Find Music on Bigg HDD/jar Caused by: java.lang.ClassNotFoundException: ..Find Music on Bigg HDD.jar at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:319) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) at java.lang.ClassLoader.loadClass(ClassLoader.java:254) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399)
Anyone know anything about this?
Thanks
-Tanner
- 09-10-2009, 01:46 AM #2
Senior Member
- Join Date
- Sep 2008
- Posts
- 564
- Rep Power
- 5
a jar is not a class. a jar is just an archive containing classes. you have to run the java command on the class with the main method.
- 09-10-2009, 12:01 PM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
Problem in running Java swing wizard in jre 1.6 while it is running in jre 1.4
By Sanjay Dwivedi in forum AWT / SwingReplies: 0Last Post: 08-26-2009, 01:03 PM -
Problems getting jar file running locally
By edpfister in forum Java AppletsReplies: 2Last Post: 03-09-2009, 08:01 PM -
error while running jar file created from netbeans
By ecstatic in forum NetBeansReplies: 2Last Post: 03-09-2009, 02:36 AM -
error while running jar file
By ernieBob in forum NetBeansReplies: 1Last Post: 03-25-2008, 11:13 AM -
Help with error message when running JAR via HTML file
By Simmy in forum AWT / SwingReplies: 7Last Post: 08-12-2007, 03:47 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks