aspose file tools*
The moose likes Beginning Java and the fly likes java.lang. NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.lang. NoClassDefFoundError" Watch "java.lang. NoClassDefFoundError" New topic
Author

java.lang. NoClassDefFoundError

Deyna Cegielski
Ranch Hand

Joined: Nov 24, 2004
Posts: 60
i havent had this problem before with setting up java on my computer but even with the most simple of programs

public class test {
public static void main(String args[]) {
}
}

i get the error:

Exception in thread "main" java.lang.NoClassDefFoundError: test

anyone know why this is?

thanks
Deyna
vignesh hariharan
Ranch Hand

Joined: Jun 23, 2005
Posts: 77
after installing java that doesnt mean that you can compile and run any java program directly.. you are supposed to set the path and then the class path too. just check if you have set those correctly.


Regards,
vignesh
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Originally posted by vignesh hariharan:
after installing java that doesnt mean that you can compile and run any java program directly.. you are supposed to set the path and then the class path too. just check if you have set those correctly.


No, you don't set the CLASSPATH - not for installation - not ever. My best guess is that the OP has set the CLASSPATH and is now observing problems as a result.

Try:
> java -cp . test

from the directory that contains test.class.


Tony Morris
Java Q&A (FAQ, Trivia)
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
i had that error the other day because i tried to compile

javac Test.java

instead of:

test.java


You down with OOP? Yeah you know me!
Deyna Cegielski
Ranch Hand

Joined: Nov 24, 2004
Posts: 60
fixed, seems quicktime had messed up my classpaths, all sorted now.

thanks for the help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang. NoClassDefFoundError
 
Similar Threads
can't call another constructor from no-arg constructor
Object of Class N declared inside Class N itself.
Help needed
package / class name
Exception in thread "main" java.lang.NoClassDefFoundError: Test