There are two common reasons for NoClassDefFoundError:
- The version of the class you (or one of the packages you're using) compiled with is not the version you're running with. This can be due to simply needing to recompile all your stuff, or due to having the wrong version of a 3rd-party JAR file in your classpath.
- You have a class that's located in x/y/z/MyClass.class, and is supposed to be in package x.y.z, but you left out (or improperly coded) the
package
statement when you compiled.
There are also a bunch of "uncommon" reasons -- NoClassDefFoundError is the "garbage" exception for something being wrong in class loading.