File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes problem in running t he program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

problem in running t he program

monica mitra

Joined: Jun 16, 2006
Posts: 7
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

Joined: May 24, 2003
Posts: 425
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

Joined: Oct 13, 2005
Posts: 46345
Please don't post the same question twice.
marc weber

Joined: Aug 31, 2004
Posts: 11343

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.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
I agree. Here's the link:
subject: problem in running t he program
It's not a secret anymore!