ClassNotFoundException [message #882406] |
Wed, 06 June 2012 08:04  |
Eclipse User |
|
|
|
Well, having initially thought it was a bug, I am typing some code, as I study for SCJP, and, when I type the following code I get a ClassNotFoundException.
I thought that is weird, however, the Eclipse Development Team kindly suggested to add JRE 1.6, which is questionable i.e. why should I need to add 1.6 when I have 1.7? do I need to do this for all the little applications that I code?
package mypackage;
public class AssertionTest2 {
public static void main (String[] args)
{
int a = 5;
assert (a != 5) : a;
}
}
java.lang.NoClassDefFoundError: mypackage/AssertionTest2
Caused by: java.lang.ClassNotFoundException: mypackage.AssertionTest2
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)
Exception in thread "main"
|
|
|
|
Powered by
FUDForum. Page generated in 0.31612 seconds