Hi,
What is the difference between NoClassDefFoundException and NoClassDefFoundError. i have found that NoClassDefFoundError occurs when i am using the "new" operator and the class definition is not present while running the program. When does NoClassDefFoundException occur?
This input is not sufficiant to conclude give your full code and package directory .Basically this error arise for package mismatching or missing of jars.
NoClassDefFoundException ? what is the fully qualified name for it? is it from sun jdk ?
or you meant java.lang.ClassNotFoundException , if yes please search here or google . there are so many discussions.
There is indeed no NoClassDefFoundException. But there is a ClassNotFoundException.
NoClassDefFoundError happens when the JVM cannot load a class that is required, almost always because you forgot to include it in the classpath.
ClassNotFoundException happens when you try to load a class via reflection (for example, when doing Class.forName("...")) and the class cannot be found. Usually this also means that the JAR or directory that contains the class file is missing from the classpath.
Note that the API documentation of NoClassDefFoundError and ClassNotFoundException also explain this, in more detail than I did above.