Java NoClassDefFoundError
Definition and Usage
A NoClassDefFoundError happens when the Java Virtual Machine (JVM, the program that runs Java code) cannot find a class that the program needs, although the class was there when the code was compiled. It is an Error (a serious problem that a program should not try to catch), not an exception.
It usually means that a .class file or a library (a .jar file with ready-made classes) is missing when the program runs. Check that all the needed files are on the classpath (the list of places where Java looks for classes).
Tip: ClassNotFoundException is similar, but happens when the program itself loads a class by its name, for example with Class.forName().
Related Pages
Java Exceptions (try...catch) Tutorial
❮ Errors & Exceptions