This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help needed ASAP :  NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help needed ASAP :  NoClassDefFoundError" Watch "Help needed ASAP :  NoClassDefFoundError" New topic
Author

Help needed ASAP : NoClassDefFoundError

Cindy Burkhardt
Greenhorn

Joined: Apr 01, 2004
Posts: 3
I am trying to run from the command line in XP. I am typing "java Main" from the current directory of Main.class. I can compile fine, just not run. Here are my environment variable paths:

Classpath: C:\Sun\AppServer\jdk\bin\java

Path: C:\Sun\AppServer\jdk\bin;

Java_Home: C:\Sun\AppServer\jdk

Can somebody please help?


Cindy
Cindy Burkhardt
Greenhorn

Joined: Apr 01, 2004
Posts: 3
I figured it out. The problem was my Classpath. It should be nothing. If one already has a Classpath set for another application, such as junit testing (as I did), you need: CLASSPATH = [other path];;

That's right, end it with a double semi-colon.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Actually, you'd do well to just make sure that your CLASSPATH includes the current working directory, as specified by a period.

The double semicolons might be some fluke that worked for you, but I'm pretty sure it's not an official behavior.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help needed ASAP : NoClassDefFoundError
 
Similar Threads
Unable to run web application when moved from Tomcat to Jboss
basic doubt!!
NoInitialContextException:
class not found error
Swing not working ...