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

problem in running t he program

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I can now compile the program. but when I try to run the program by typing java classname say java Add .It throws me an exception message "Exception in thread "main" java.lang.NoClassDefFoundError:Add".
why am i getting this message ?what should I do?
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
You need to set the classpath to current folder where the compiled class exists.

For Windows
SET classpath=%CLASSPATH%;.

and then execute the java command
 
Marshal
Posts: 79174
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't post the same question twice.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
We try to keep these forums as neat as possible, so people can find what they need without going down too many dead ends, and people who are trying to help don't waste their time answering questions that have already been answered under a duplicate post.

If you're starting a new topic, that's great. If you're continuing a previous topic, then please keep it in the same thread. (Don't do both.)

With that in mind, please continue this discussion here.
 
    Bookmark Topic Watch Topic
  • New Topic