Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Annoying "NoClassDefinitionFound" error


ghost's Avatar
0 0

Hello,

I am running ubunto dapper, and using Anjuta IDE, and the java code compiles oksy, but the jvm says it can't find the class file to run, here is a screenshot of what happens, figures it would be easier than explaining…

http://img73.imageshack.us/img73/3573/screenshot4yr0.png

Please help :(


ghost's Avatar
0 0

Normally " java.lang.NoClassDefFoundError" comes when added ".class", google tells me so!

Maybe thats the prob?


ghost's Avatar
0 0

Java is case sensitive.

Your file is named "javaTest.java", therefore the main class must be "javaTest", not "JavaTest"

I see no problems with that source, otherwise.


ghost's Avatar
0 0

The class /file name is correct, that's ajunas font, notice there's no . on the top of the J,


Uber0n's Avatar
Member
0 0

String args[]

should be changed into

String[] args


ghost's Avatar
0 0

Sorry about my oversight earlier, but Uber0n is correct. I'm actually intrigued as to why I'm allowed to compile a Java program with characters other than letters in a variable name.


ghost's Avatar
0 0

I tried changing it to String[] args, but still the same, It might be something wrong with my JRE setup, or maybe the IDE. shrugs


ghost's Avatar
0 0

This is bollox. Or maybe it's the gods telling me to stay from Java and stick with c++.:right:


Uber0n's Avatar
Member
0 0

This should work…

{
    public static void main(String[] args)
    {
      System.out.println("Test");
     }
}```

Uber0n's Avatar
Member
0 0

PlagueZ wrote: maybe it's the gods telling me to stay from Java and stick with c++.:right:

It probably is. But it never hurts to learn some Java anyway :D


ghost's Avatar
0 0

It was the IDE that wasn't confgured properly, sorry about this guys. :@