Jump to content

How to set JDK path in Windows (so Javac command works)


The Pezman
 Share

Recommended Posts

Compiling java programs in the Mac command line is usually a painless process. Java paths are set automatically, so javac will work. Not so in Windows, apparently. Even if I download the latest JDK, "javac" is an unrecognized command. I even followed instructions for how to set the path as indicated here, but no luck. Any advice/help?

Link to comment
Share on other sites

Hi there. That's quite a quandary, but most things involving the manual-editing of the PATH variable usually end up that way. :-(

Would I be correct to assume you're using Windows XP? If so, are you making sure to type all the periods and underscores? If you're putting the Java path as the last thing on the line, are you making sure there's not a semicolon after it in the path text field? Sorry for all the questions, I'm just trying to figure out what's going on here.

By the way, another way to get to the path variable is to go to the Start Menu -> Right-Click on "My Computer" -> Select "Properties" -> Click on the "Advanced" tab -> Select "Environment Variables" and then proceed to edit from there.

Sorry I couldn't help at the time.

Link to comment
Share on other sites

Wonder why the JDK installer didn't do this for you, I've installed and reinstalled it dozens of times since...a while go...great now I feel old...anyways, and it should have done it for you. All you need to do is go to enviromental variables like Mr. L says, select the path from the BOTTOM list, click edit and add ';D:\Program Files (x86)\Java\jdk1.6.0_17\bin' with that very nice semicolan at the front. Replace the path to the bin directory with whatever it is on your machine. If that doesn't work, you sure you have an actual javac.exe?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...