Issue
I have a recurring bug when attempting to run Netbeans (7.2), last time I had it, I found somewhere that you can just move all your files to a new project. That will probably work, but the size of my project makes that quite a hassle. Here is the trace...
Exception in thread "main" java.lang.NoClassDefFoundError: X.X.X.X
Caused by: java.lang.ClassNotFoundException: X.X.X.X
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: X.X.X.X Program will exit.
It's definitely there, it was fine 10 minutes ago and I haven't touched it.
I'm pretty sure it has something to with the automatic compiling (and perhaps code-completion features) of netbeans. Is there a way I can just reset all the internal data without moving everything to a new project. Or any other suggestions.
Solution
In cases described, it usually helps me to delete whole cache of Netbeans.
So close Netbeans.
Locate directory with netbeans cache and delete its content.
It's usually located in [USER_HOME]\.netbeans\7.x\var
- delete everything in var
directory.
Answered By - Ondrej Bozek
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)