Core Java Interview Questions and Answers
Ques. How to resolve NoClassDefFoundError?Ans. 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?
- When should I use abstract methods?