Question: I’m receiving this message when attempting to compile some java code:
'javac' is not recognized as an internal or external command, operable program or batch file
How can I fix this problem?
Answer: If you installed the JDK in
C:\jdk1.6.0. At the prompt you would type the following command and press Enter:
If you choose this option, you'll have to precede your
java commands with
C:\jdk1.6.0\bin\ each time you compile or run a program.
If the system cannot find javac or java, check the set path command.
It is possible to make the path setting permanent but be careful because your system might crash if you make a mistake.
In Windows XP, go to Control Panel, choose "System," click on the "Advanced" tab, click on the "Environment variables" button. In the lower list, "System variables," click on Path:
Click "Edit" and at the end of the string, append
(or the path to the relevant directory where the latest version of JDK is installed). Watch for spaces.
Click OK on the path edit box and OK on the Environment Variables box. The new setting will go into effect next time you run Command Prompt.