Meaningless Drivel is fun!*
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
Author

problem in running t he program

monica mitra
Greenhorn

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
Sheriff

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

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
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in running t he program
 
Similar Threads
NoSuchMethodError
Runtime exception
please help me to set the path
Error msg in NetBeans 4.1
Exception oin thread "main"