Reputation: 455
I am trying to compile some java code on Windows 7 pc, I have installed java JDK and I am trying to use the javac
command in cmd but I get output saying that
'javac' is not recognized as an internal or external command,
operable program or batch file.
What do I have to do to enable compiler in cmd or is it possible to do in Windows?
Upvotes: 1
Views: 148
Reputation: 2064
1)Go to properties by right click on icon Computer , then navigate to Advanced System Settings.
2)Click Environment Variables.
3)Click on New , set Variable name as path and Variable path as the path of java jdk installation directory which could be something like this -
C:\Program Files\Java\jdk1.6.0_23\bin;
where C:** is the drive where JDK is installed and **Program Files\java is the directory where it resides.
look out for semi-colon(;) at the last.
4)Click ok
5)Restart cmd and run javac , it should work now.
Look for Screenshots here for more help.
Regards
Anshul
Upvotes: 1
Reputation: 6801
Your java directory is not on the path. Here are some helpful screenshots to show how to set it up: http://vietpad.sourceforge.net/javaonwindows.html
Upvotes: 0