LegendaryLaggy
LegendaryLaggy

Reputation: 455

Java windows command

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

Answers (4)

anshulkatta
anshulkatta

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

Jens Hoffmann
Jens Hoffmann

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

kaysush
kaysush

Reputation: 4836

Add the path to bin folder of JDK in your PATH variable. For instructions to set PATH variable follow this tutorial.

Upvotes: 0

Obl Tobl
Obl Tobl

Reputation: 5684

you have to set a new system variable for your JAVA_HOME in windows.
See here for further information.

Upvotes: 0

Related Questions