I have an issue with NoClassDefFoundError
. I am using interfaces, and no class definition should be available:
package code;
public interface Constants {...}
The class implementing this interface compiles without any errors, and a JAR file has been built, but at runtime it gives me an error.
import ...;
import code.*;
public class MultiDoc extends LanguageAnalyser implements Constants{}
Constants
contains only a list of constants.
I read some posts pointing to CLASSPATH as a cause of this problem, but I have the code
package in my CLASSPATH. If I didn't have it, it would produce a compilation error. So, the problem should be something else.
The runtime error is:
java.lang.NoClassDefFoundError: code/Constants
What's the solution?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…