Showing posts with label ClassNotFoundException. Show all posts
Showing posts with label ClassNotFoundException. Show all posts

Thursday, August 7

Difference between ClassNotFoundException vs NoClassDefFoundError

ClassNotFoundException Vs NoClassDefFoundError


ClassNotFoundException :  ClassNotFoundException occurs when class loader could not find the required class in class path. So, basically you should check your class path and add the class in the classpath.

NoClassDefFoundError : This is more difficult to debug and find the reason. This is thrown when at compile time the required classes are present , but at run time the classes are changed  or removed or class's static initializes threw exceptions. It means the class which is getting loaded is present in classpath , but one of the classes which are required by this class , are either removed or failed to load by compiler .So you should see the classes which are dependent on this class.

Ads Inside Post