Yes I have a project that I’m working on in NetBeans 7.1 and I come to the point where I want to use the jar file on a different computer but when I try to run it it gives a NoClassDefFoundError. But when I run it on my computer it works fine. I’ve extracted the .jar file all the classes seem to be there. I’ve checked to see if netbeans thinks my project is the main project and that it has a main class which I also confirmed in the MANIFEST.MF file. My program does have swing components if that affects anything.
Edit
Also there are no other folders in my dist folder like any lib or picture folders
I have also clean and rebuilt about a hundred times
/Edit
Here is the error
Caused by: java.lang.ClassNotFoundException: ClubControl.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I have searched through countless articles on this subject and still I don’t think I have found the problem. Hopefully I didn’t miss it and someone responds with a link to another question.
If any other info is needed just ask.
Edit
here is the MF file
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.3
Created-By: 1.7.0_01-b08 (Oracle Corporation)
Class-Path:
X-COMMENT: Main-Class will be added automatically by build
Main-Class: GUI.MainWindow
From the exception stacktrace it would seem that a class is misnamed somewhere in your code:
It appears to be trying to load up a class named
ClubControl.jar– there should be no extension on the name, and definitely not a .jar one.