• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RE : JAVA Question for ALL

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
See where your hand is? Not there. It's next to this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic