Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "RE : JAVA Question for ALL" Watch "RE : JAVA Question for ALL" New topic
Author

RE : JAVA Question for ALL

Jitty
Greenhorn

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.
PLEASE HELP...THANKS TO EVERYONE
Cindy Glass
"The Hood"
Sheriff

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"
Sheriff

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.
Thanks,
Cindy

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

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?
OR
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: http://aspose.com/file-tools
 
subject: RE : JAVA Question for ALL
 
Similar Threads
RAD 7.5.4 - Debugger going to wrong lines during debug session
Socket connection problem, need a hand..
A few questions since I am new to Java
Something is wrong with my Java on LInux...
RE : Java Beginner