Class Not Found vs No Class Def Found When we are working on JavaEE, we will always has multiple issues related to classes and ClassLoader . We may struggle to find some strange memory leaks caused by ClassLoader ; we may fail to run some applications because it fail to find some class; we may encounter cases when multiple versions of library conflict. In order to solve all similar problems one for all, today we focus the understanding of two exception (to be precise, one exception and one error): java.lang.ClassNotFoundException java.lang.NoClassDefFoundError ClassLoader Before we get to solve the problem, we have to skim some basic knowledge of class loading. In the world of Java, almost all things are abstracted into a class. Class is also a class, which organized by classpath and package structure. In order to load classes when suitable, JVM use the abstraction of ClassLoader to locate or generate data that constitutes a definition for the class. Th...
Learn programming, still on the way