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

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

Symptom)
When I installed JDK for Window7 and tried to compile a '*.java' file in the cmd prompt. Suddenly, I got this message below.

Root Cause)
The error message means Windows cannot access JDK globally. So I had to setup System path to make Windows recognizes and runs JDK globally. Since JDK1.8 later version, JDK setup System path automatically. In the lower than that of version, System path should be added manually.

Solution)
Step1. Right click on 'Computer' icon. Click [Properties].

Step2. Click [Advanced System Settings].

Step3. Click [Advanced] tab. Click [Environment Settings].

Step4. Go to installed JDK path.
Go to 'C' Drive and Copy installed JDK directory.

Step5. Back to [Environment Variables]. Click [New] in 'User Variables'.

Step6. Enter 'JAVA_HOME' in the variable name.
Paste installed JDK directory and click [OK].

Step7. Double click 'path' in 'User Variables'.

Step8. Insert '%JAVA_HOME%bin;' and click [OK].
Make sure that you have to insert it right before ';'.
For example, if Variable name is 'C:Program Files\something;',
then you have to insert it like
'C:Program Files\something;%JAVA_HOME%bin;'.

Step9. Double click 'path' in 'System Variables'.

Step10. Insert '%JAVA_HOME%bin;' and click [OK].


Step11. Click [OK] continuously.

Step12. Check out JDK path setting is finished successfully.
open command prompt. Enter 'java -version'.

Step13. if you got this, JDK path setting is finished.




Comments

Popular posts from this blog

$$ Regular Expression이 안먹는 경우

exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 52.0

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver