jQuery in Action, 3rd edition
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help needed ASAP :  NoClassDefFoundError" Watch "Help needed ASAP :  NoClassDefFoundError" New topic

Help needed ASAP : NoClassDefFoundError

Cindy Burkhardt

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 Burkhardt

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

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
It's not a secret anymore!