What is the difference between NoClassDefFoundError
and ClassNotFoundException
?
What causes them to be thrown? How can they be resolved?
I often encounter these throwables when modifying existing code to include new jar files.
I have hit them on both the client side and the server side for a java app distributed through webstart.
Possible reasons I have come across:
- packages not included in
build.xml
for the client side of code - runtime classpath missing for the new jars we are using
- version conflicts with previous jar
When I encounter these today I take a trail-and-error approach to get things working. I need more clarity and understanding.