Core%20Java%20Interview%20Questions%20and%20Answers
Question: How to resolve NoClassDefFoundError?Answer: Obvious reason of NoClassDefFoundError is that a particular class is not available in Classpath, so we need to add that into Classpath or we need to check why it’s not available in Classpath if we are expecting it to be. There could be multiple reasons like:1) Class is not available in Java Classpath. 2) You might be running your program using jar command and class was not defined in manifest file's ClassPath attribute. 3) Any startup script is overriding Classpath environment variable. |
Is it helpful?
Yes
No
Most helpful rated by users:
- How could Java classes direct program messages to the system console, but error messages, say to a file?
- What are the differences between an interface and an abstract class?
- Why would you use a synchronized block vs. synchronized method?
- How can you force garbage collection?
- What are the differences between the methods sleep() and wait()?