Results 1 to 1 of 1
- 12-19-2010, 07:23 PM #1Member
- Join Date
- Dec 2010
- Rep Power
random java.lang.NoClassDefFoundError's in Netbeans
Hello all :)
I'm making a game in java and it's all going pretty well so far, since I'm pretty fluent in C# the jump was quite painless, save for this one thing that's driving me mad. :(
I'll occasionally (say 3/4 times a day while coding) get a runtime error saying something like:
java.lang.NoClassDefFoundError: zombie/ZombieGame Caused by: java.lang.ClassNotFoundException: zombie.ZombieGame 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:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Could not find the main class: zombie.ZombieGame. Program will exit. Exception in thread "main" Java Result: 1
The solution tends to be:
Comment out a function body in the offending class.
Run it, let it crash from the missing contents of the function
Uncomment the function.
Run it again, the NoClass error will now appear for another class.
Comment out a line from that function, run it.
Oh dear still an error in that class.
Comment out a different function.
Rince and repeat.
It takes like about 2 hours out of my day total, and it disappears as randomly as it appears usually after me displacing the error between 3/4 classes before finally it runs. I've tried full clean rebuilds and whatnot, and I'm at a loss. Not sure what info to provide to help anyone diagnose the problem though. :(
I've tried extensive googling, but the only things I find are solutions that seem to imply that the program could never run without the fix, but since this is intermittent and random it feels more like a compiler bug or something.
Last edited by lemmy101; 12-19-2010 at 07:28 PM.
- By rameshraj in forum JDBCReplies: 5Last Post: 03-17-2011, 03:26 PM
- By Leroy in forum Advanced JavaReplies: 8Last Post: 11-04-2010, 02:46 PM
- By baktha.thalapathy in forum New To JavaReplies: 5Last Post: 06-02-2010, 02:05 PM
- By baktha.thalapathy in forum Advanced JavaReplies: 3Last Post: 06-01-2010, 04:01 PM
- By baltimore in forum New To JavaReplies: 2Last Post: 09-18-2008, 08:30 AM