my dog learned polymorphism
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ClassNotFoundException Vs NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "ClassNotFoundException Vs NoClassDefFoundError" Watch "ClassNotFoundException Vs NoClassDefFoundError" New topic

ClassNotFoundException Vs NoClassDefFoundError

Saibabaa Pragada
Ranch Hand

Joined: Oct 24, 2010
Posts: 162
Hi, What is the difference between ClassNotFoundException(Checked Exception) and NoClassDefFoundError(Error)..I am not able to figure out from API
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

The ClassNotFoundException throws when trying to load a class using reflection, but is not found on the class path. The NoClassDefFoundError throws when the class could not be loaded due to some inconsistencies. Missing JAR files or incompatible classes are most common examples.
I agree. Here's the link:
subject: ClassNotFoundException Vs NoClassDefFoundError