Your PATH appears to be correct because otherwise it would give an error message starting "javac is not recognized . . ." Which directory have you got your Hello.java file in? I presume you are in the same directory; on Windows you can verify its presence with "dir" and on *nix you would use "ls".
[diversion]So far, so good; I have told you more or less the same as Marc, who seems to have beaten me by a few seconds. And I see he has passed 10000. Congratulations, Marc.[/diversion]
Once you have found your Hello.java file, try inserting " -cp . " between "javac" and "Hello.java" (minus the quotes). Several people have posted in the last few weeks with the problem of not having a CLASSPATH set. You can set a CLASSPATH for the lifetime of your present terminal window by writing something like set classpath=.;%CLASSPATH% See this link.
You will see all sorts of things on the net telling you to put this that and the other in your system CLASSPATH; there is only one thing you really need on Windows, which is a dot. It can appear as . or .; or ;. or ;.; and it doesn't seem to matter if it appears twice. You can set up your CLASSPATH by a similar process to setting the PATH; if there is no CLASSPATH at all, you can create one by writing CLASSPATH (it is probably not case-sensitive) in the box and . in the next box. Close your command line window; the CLASSPATH will only work in a new terminal. I usually use Linux, where it seems to work with no CLASSPATH set at all.
Joined: May 02, 2008
ahhh i got it, cheers, i was having problems saving files in the right directory, if that makes sense. The smallest problems can have you pulling your hair out.
Joined: Oct 13, 2005
Originally posted by j patrick: ahhh i got it, cheers . . . The smallest problems can have you pulling your hair out.
You're welcome ( ). And I remember spending weeks failing to get anything to compile when I first started. I know exactly how it feels.
And you have obviously now got your CLASSPATH sorted out.