• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help needed ASAP : NoClassDefFoundError

 
Cindy Burkhardt
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic