File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes RE : JAVA Question for ALL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "RE : JAVA Question for ALL" Watch "RE : JAVA Question for ALL" New topic

RE : JAVA Question for ALL


Joined: Sep 24, 2001
Posts: 2
I would like help from all the Java Gurus out there.
Recently , I tried to run my java code and though it compiles fine when running it gives me an error saying "Exception in thread "main" java.lang.NoClassDefFoundError: Hello...
I have checked my path and it is correct and actually I had not done anything to the computer before and it was running before. I wonder if ther is anything that I had missed out or if I am over looking something.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Your classpath is not set to include the directory that your Hello.class file is in.
Do a search for classpath (see below the 2 buttons above) and you will find zillions of threads on classpath.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Oh yeah, Jitty-
Please change your name to be compliant with JavaRanch's naming policy.
Your ID should be 2 separate names with more than 1 letter each. It should not be obviously fictitious. We really want this to be a professional forum and would prefer that you use your REAL name.

[This message has been edited by Cindy Glass (edited September 24, 2001).]
Siddalinga Murthy

Joined: Sep 17, 2001
Posts: 10
The classpath does not include the class which you are trying to run.i.e,
If you are in c:\ and compiled in the same directory and your classpath is ../jdk1.2/bin
Then it won't find the class and give the error
Jamie Young
Ranch Hand

Joined: Jun 19, 2001
Posts: 31
It sounds like you do not have a main method in the class you are trying to run. Do you have a main method?
Are you using a class that requires to be imported and failed to do so. Check your import statments.
I agree. Here's the link:
subject: RE : JAVA Question for ALL
It's not a secret anymore!