Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RE : JAVA Question for ALL

 
Jitty
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic