Adding Javac to Environment Variable in XP

Hi.

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.

Brgds
Imran
imamdaniAsked:
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 http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html 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.
0
 
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
0
 
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.

0
Upgrade your Question Security!

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

 
VenabiliCommented:
>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.
0
 
imamdaniAuthor Commented:
ah, i was thinking PATH is something I had to add. such a duff!
Thanks guys for clearing this out.
0
 
imamdaniAuthor Commented:
..
0
 
VenabiliCommented:
:) If you had never dealt with the variable, I can understand the confusion :)

Good luck with your Java studies.
0
 
imamdaniAuthor Commented:
Thanks matey.
:)
0
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.