Hi sajee
ClassNotFound is thrown when a system can't find a class its trying to load. e.g.
Class.forName("someClass"); and if system can't find the class with "someClass" name it will throw this exception.
example,
Create a class D which tries to load class named "someClass" which doesn't exist,
Here is the output when you try to run the class D,
NoClassDefFound is thrown when the system can't find a dependent class which was there when the containing class got compiled. e.g.
Create two classes A.java , B.java like,
Now compile A class like,
$javac A.java
It will get compiled and you will see A.class and B.class created.
You can run class A like,
$java A
This will work fine.
Now rename the B.class file with something else, say C.class.
Now run class A again,
$java A
It will give this error,
Hope this helps.
Similar google groups link,
http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8c15027576869f/dad6446f897f8946?lnk=st&q=classnotfoundexception+noclassdeffounderror&rnum=1#dad6446f897f8946 Regards,
Maulin