aspose file tools*
The moose likes Beginning Java and the fly likes NoClassDef erorr Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "NoClassDef erorr" Watch "NoClassDef erorr" New topic
Author

NoClassDef erorr

Joe Cooper
Greenhorn

Joined: Nov 09, 2005
Posts: 2
As you can tell from the error above I am complete newbie. I am running java on windows NT (from a cygwin shell)

I can compile my helloWorld.java with no problems, but when running
java helloWorld I get the error java.lang.NoClassDefFoundError.

Doing some research I found that I can run
java -classpath . helloWorld

So my problem seems to be a classpath, however when I check my enviroment I find:
CLASSPATH=C:\Program Files\Java\jdk1.5.0_05\bin;C:\Program Files\Java\jre1.5.0_0

This is the correct path. Any help would be appreciated.

Thanks in advance.
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
is your helloWorld class in a directory thats in your classpath?


Who dares, wins! (SAS motto)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

That's not a correct setting for CLASSPATH. CLASSPATH is used to find .class files, not executable files, and in general, until you really know what you're doing, it's best to leave it completely unset -- i.e., you should have no CLASSPATH setting at all. See here for lots more info.


[Jess in Action][AskingGoodQuestions]
Joe Cooper
Greenhorn

Joined: Nov 09, 2005
Posts: 2
Thanks for the help. Working now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDef erorr