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

problem in running t he program

 
monica mitra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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?
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • 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
 
Campbell Ritchie
Sheriff
Posts: 48440
56
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post the same question twice.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • 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