04 May,2012 by Tom Collins
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:
C:\jdk1.6.0\bin\javac MyDB2.java
If you choose this option, you'll have to precede your javac
and 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
;C:\Program Files\Java\jdk1.6.0\bin
(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.
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |