• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with XP  RSS feed

 
Nick Kunstle
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First let me say that I am a beginner to programming, Java is my first serious language besides some scripting. I have been trying to get my first compiler/Program to run (Hello world) on WindowsXP working in the Cprompt, when I go to run It I get the following error

Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

I have checked procedure twice to make sure I have followed the directions explicitly with no help, any suggestions??

I have tried the same program on my mac and it worked right away, I work cross platform (Desktop Mac Laptop PC) and was hoping I could do java work on both.

PS the ranch looks awsome I have a feeling I will return a lot
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is most likely a problem with your CLASSPATH.

Do you see the file HelloWorldApp.class in your current directory?

If you do, and the compiler won't see it, then you can either alter your system CLASSPATH and include the current directory, ., in it, or you can override the system CLASSPATH and include the CLASSPATH on the command line with

java -cp . HelloWorldApp
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nick Kunstle:
...I have tried the same program on my mac and it worked right away...

Nothing unusual there.

Welcome to JavaRanch! I think Keith's advice should help you -- if not, post back.
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go inte to control panel and click the on the system
Click on the advanced tab
Click on the Environment variables

Make sure that you have a variable CLASS_PATH and that your working path is in value.

Close the cmd and reopen it
 
Nick Kunstle
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Changing the CLASSPATH worked
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!