File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Path Name Again Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Path Name Again" Watch "Path Name Again" New topic

Path Name Again

Al Garcia

Joined: Sep 25, 2007
Posts: 2
I downloaded and set-up SDK to learn Java with the Headfirst book but am having the same problem others have with getting the cmd prompt to recognize the javac & java commands without typing in the path. I've been through the documentation and have read all the treads on the forum but can't get it to work.

Details -

I'm running Windows XP and just downloaded the latest which is sdk 6 I think.

I found the java/javac files at this location after installation: C:\Sun\SDK\jdk\bin

If I enter this path at the command prompt it will compile or run the 'HelloWorld' program fine. I changed my Path variable in settings to this same address but it doesn't work.

I also found a second & third java.exe file at:C:\Program Files\Java\jre1.5.0_11\bin & C:\Program Files\Java\jre1.5.0_06\bin and tried these as the path name but it did not work. If I enter this path in the prompt line along with 'java' and program name it won't run so I don't think this is the right.

One other thing, I changed the Path Class variable to C:\Sun\SDK\jdk\bin and it didn't work. I didn't copy what was in there originally which I'm kicking myself for (it was something java related). I deleted the file after this & it still doesn't work.

Any help would be greatly appreciated.

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

easiest thing first:

did you open a new command window after editing your path? an existing/open window won't pick up the changes.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Al Garcia

Joined: Sep 25, 2007
Posts: 2
Fred, I'm embarrased but that was it. Thanks for the help.
I agree. Here's the link:
subject: Path Name Again
It's not a secret anymore!