• Post Reply Bookmark Topic Watch Topic
  • New Topic

what NoClassDefFoundError means?  RSS feed

 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have tried to read javadocs for java.lang.NoClassDefFoundError and I have bumped into that error for couple of times BUT I am not clear about the problem.

If at compile time class was there it means its .class file can be found by runtime as well, right? Then how can we get this error?

I don't remember how did I solved this problem whenever encountered amidst lot of web/app server's complexity...

Any thoughts and pointers would be appreciated.

Can we write a program to produce this error and understand it?

Thanks
Maulin
 
Stefan Krompass
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Maulin Vasavada:
If at compile time class was there it means its .class file can be found by runtime as well, right? Then how can we get this error?

If you want to call a Java-class which is not there, a NoClassDefFoundError is thrown... This can happen if you have a class Test in a package mypackage and you just type instead of in the root-directory of your project even if you have compiled your source successfully.
Another rather simple reason is that your class-file has been removed.
These is all I can come up with now. You could try the JAVA language specification for further details...

bye

Stefan
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stefan

Thank you. That makes sense.

Regards
Maulin
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!