I have been searching all over the net for the past few hours trying to find a solution to this horrible problem.
I have a simple program:
Code:
class Test {
int number=0;
public static void main(String args[]) {
Test t = new Test();
System.out.println(t.number);
}
}
Here was my first method of compilation/execution:
I simply used the Java SDK.
[mike@localhost Java]$ javac test.java
[mike@localhost Java]$ java test
Exception in thread "main" java.lang.NoClassDefFoundError: test
There is the problem: "Exception in thread "main" java.lang.NoClassDefFoundError: test"
I am able to successfully compile the java file, but when it comes to executing it, it gives me trouble. I have tried other simple programs(such as the basic HelloWorld) and they all give me the same trouble.
My second method of compilation/execution:
I downloaded NetBeans IDE 3.6.
I created a project file and used the same code from above. The compilation went smooth, but once again, I got that error.
I have read in other places that I'm missing the classpath, but I'm unsure which .jar file I should be looking for.
Any help is always appreciated.
Thanks,
Mike