Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set the PATH variable for javac so I can manually compile my .java works?

Here's the address on my drive:

C:\Program Files\Java\jdk1.6.0_18\bin

How would I go about setting the path variable so I can go in command window (windowskey+r "cmd") and be able to type things like:

javac TestApp.java

I'm using Windows 7 Professional.

like image 964
Sergio Tapia Avatar asked Jan 17 '10 01:01

Sergio Tapia


People also ask

Where is the PATH for javac?

Check your javac path on Windows using Windows Explorer C:\Program Files\Java\jdk1.

Which environment variables is used to set the Java PATH?

Correct Option: D. JAVA_HOME is used to store a path to the java installation.


1 Answers

That would be:

set "PATH=%PATH%;C:\Program Files\Java\jdk1.6.0_18\bin"

You can also append ;C:\Program Files\Java\jdk1.6.0_18\bin to the PATH in the user environment dialog. That would allow you to use javac and other java tools directly form any cmd shell without setting the path first. The user environment dialog used to be somewhere in the system properties in XP, I have no idea where it is in Windows 7.

like image 151
x4u Avatar answered Oct 22 '22 13:10

x4u