I am getting the following error when I am trying to run a java program.
"Exception in thread "main" java.lang.NoClassDefFoundError:"
I have a book folder in which I have a file Goo.java
package book;
import cert.*;
class Goo
{
public static void main(String[] args)
{
Sludge s = new Sludge();
s.testIt();
}
}
I have a cert folder in which i have a file Sludge.java:
package cert;
public class Sludge
{
public void testIt()
{
System.out.println("Sludge");
}
}
I have both the folders (book and cert) under D:\studies and my classpath includes:
.;C:\Program Files\Java\jre6\lib;C:\Program Files\Java\jre7\lib\ext\QTJava.zip;C:\Program Files\Java\jdk1.7.0\lib;D:\studies\book;D:\studies\cert;D:\studies
When I try to run the file Goo.java, I get the NoClassDefFoundError.
What am I doing wrong here??
Thanks, Priyesh T.
Goo.classandSludge.class. Please verify, that both java files have been compiled. - Andreas Dolk