Adding Javac to Environment Variable in XP


I have installed Java SDK 1.5 and Textpad.

However, as I am trying to add javac to the environment variable in XP, after entering the name as "javac" and variable path as "C:\Java\jdk1.6.0_20\bin". When I go to the command prompt, and type in javac, it comes out with an error;

'javac' is not recognized as an internal or external command,
operable program or batch file.

ps. using textpad, I could add special commands that enables me to compile and run java files (using Ctrl + 1 and 2) but using plain command prompt, unless I go to the bin folder it does not work.

Please help.

Who is Participating?
VenabiliConnect With a Mentor Commented:
You do not need to declare javac as a variable - it is a command.

As wannabetechie says - just add the path to the bin folder in the PATH variable.

See and especially "4. Update the PATH variable (Optional) " for exact instructions and details.

And you can always use the full path to the javac command of course.
wannabetechieConnect With a Mentor Commented:
Add the "C:\Java\jdk1.6.0_20\bin" to your Path variable in the System variables section rather than creating a new variable
imamdaniAuthor Commented:
When you say add, does it not mean creating a new variable.

Nevertheless, I deleted the previous entry from user variables, and added a new variable in the system variable section.
Name: javac
Value: C:\Java\jdk1.6.0_20\bin

Still does not work.

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

>When you say add, does it not mean creating a new variable.

Nope, it just means to add a value to the already existing PATH. If it is not there, then create it but it should be there.
imamdaniAuthor Commented:
ah, i was thinking PATH is something I had to add. such a duff!
Thanks guys for clearing this out.
imamdaniAuthor Commented:
:) If you had never dealt with the variable, I can understand the confusion :)

Good luck with your Java studies.
imamdaniAuthor Commented:
Thanks matey.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.