On my computer the Java 1.7.0 compiler was installed at C:\Program Files\Java\jdk1.7.0\bin. The javac compiler is located in this directory. The standard Java 1.7.0 installation creates this directory to store the javac compiler.
I found it only necessary to set one system variable for Windows Vista to get the Java compiler to execute in any directory. And that is the Path Variable. Simply prefix the Path variable (in the system variable menu of the environment variables window) with the path location that specifies the location of the javac compiler and you will be set to go.
In my case, after addition of the javac path location to my Path variable, my path variable appears as below. Note that C:\Program Files\Java\jdk1.7.0\bin; is placed in front of the all the other preexisting path variables. Also note the use of the semicolon to separate the jdk path variable from the other path variables. Also note that there are no spaces that separate path variables. And also note that your path variable will contain numerous path variables that have been installed by other programs.
After you alter your path variable, close your command line window and restart again. And then type javac. You should see a number of javac options scroll by.
Visit http://introcs.cs.princeton.edu/java/15inout/windows-cmd.html for further information.
Also see http://www.youtube.com/watch?v=LR_sDdZ0aOk for a quick video on how to install Java, setup the environment variables and compile Java programs. It includes not only quick instructions for setting up and running Java on windows but also on Unix.
As a final note, all your Java programs need to be compiled before you can execute them.
PATH VARIABLE FOR jdk1.7.0 in Windows Vista (Prefix the bolded section to your existing path variable list.
C:\Program Files\Java\jdk1.7.0\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\COMMON~1\ULEADS~1\MPEG;C:\PROGRA~1\MICROS~3\Office;C:\PROGRA~1\TIEDUC~1\TI-83P~1\UTILS;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\PROGRA~1\COMMON~1\Odbc\FILEMA~1;C:\Program Files\Calibre2\;%QUARTUS_ROOTDIR%\bin;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Heroku\bin;C:\Program Files\git\cmd;C:\Program Files\scala;
No comments:
Post a Comment