Frustrating "NoClassDefFound"
Hello,
I am trying to do something simple.
I have created directory structure /javacode. Under it there is directory called "maincode". Under "main" there are two directories "utils" and "threads".
In threads I created a java file called Thread2.java:
package main.threads;
class Thread2 {
}
It compiles just fine, and the output is written to the same directory.
In utils I created a java file called Utils2.java:
package main.utils;
import main.threads.*;
class Utils2
{
// main method
}
it compiles fine as well and the output is written to the same directory (it even uses the class Thread2)
However, when I try to run the Utils2 class I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: maincode/utils/Utils2
I run it using the following command:
java maincode.utils.Utils2 -cp /javacode
When I try to run it just as
java Utils2 -cp /javacode
I get the error
Exception in thread "main" java.lang.NoClassDefFoundError: Utils2 (wrong name:
maincode/utils/EvalDep)
Any ideas why?
Thanks.

