Java ClassFormatError
Definition and Usage
A ClassFormatError happens when the Java Virtual Machine (JVM, the program that runs Java code) tries to load a .class file (a compiled Java class) that is damaged or not in the correct format. It is an Error (a serious problem that a program should not try to catch), not an exception.
It does not happen in normal programs that you compile and run yourself. A common kind of it is UnsupportedClassVersionError, which happens when a class was compiled with a newer Java version than the one that runs it. The fix is to compile the code again, or to run it with a newer Java version.
Related Pages
Java Exceptions (try...catch) Tutorial
❮ Errors & Exceptions