Thursday, August 5, 2010

Compiling Java in Windows 7

The java compiler javac from the latest JVM is used here. It should be downloaded from here:



  http://www.oracle.com/technetwork/java/javase/downloads/jdk6-jsp-136632.html

Click Start|Computer

Right click Computer and choose Properties



In the System window displayed click Advanced system settings.
The System Properties window is displayed as shown.





















Click Environment variables...button

In the Environmental Variables window



















Highlight the System variable Path.

Click Edit...










The Edit System Variable window is displayed.


Copy the variable value to Notepad

To add the java compiler to this list append the path to its directory

at the end like: ;C:\Program Files\Java\jdk1.6.0_21\bin\;

Click OK to this window

Click OK to the Environment Variables window

Click OK to the System Properties window

Close the System window.

Now open a cmd window (DOS screen) and verify that you can run javac. If you don't provide a file name you get the following displayed. You can run from other directories as well.