STEP 1: Install JDK/JRE: Environment Variable - PATH
STEP 1: Install JDK/JRE: Environment Variable - PATH
Run the downloaded installer, which installs both the JDK (Java Development Kit) and JRE
(Java Runtime). By default, the JDK and JRE will be installed into directories "Program
Files\java\jdk1.6.0_xx" and "Program Files\java\jre1.6.0_xx", respectively, where
"xx" is the update number. For novices, accept all the defaults.
The JDK installed directory is hereafter denoted as $JAVA_HOME (Unix notation) or %JAVA_HOME%
(Windows notation) in this text.
For Advanced Users: The default directories work but I recommend avoiding "Program
Files" because of that blank character in the directory name, which is not Unix-friendly. You
may change the installed directory for JDK and JRE during installation. I personally installed
JDK and other programming tools in "d:\bin" for ease of maintenance.
Windows Operating System searches the current directory and the directories listed in the PATH
environment variable for executable programs invoked from the CMD shell. JDK's programs (such
as compiler javac.exe and runtime java.exe) reside in directory "$JAVA_HOME\bin" (where
$JAVA_HOME denotes the JDK installed directory you have chosen in the previous step). This
directory needs to be included in the PATH.
• Click the "Start" button ⇒ "Control Panel" ⇒ "System" ⇒ (Vista only) "Advanced
system settings".
• Switch to "Advanced" tab ⇒ "Environment Variables..."
• In "System Variables" box, scroll down to select "PATH" ⇒ "Edit..."
• In "Variable value" field, type "c:\Program Files\java\jdk1.6.0_xx\bin" (if this is
your installed directory, change "xx" to the actual update number) in front of all the
existing directories, followed by a semi-colon (;) to separate the JDK's directory from the
rest of the directories. DO NOT delete any existing path entry, otherwise, other
applications may not run. For example,
Refer to "Environment Variable - PATH" for more discussion about PATH environment variables.
For Advanced Users: I suggested that you place the JDK bin directory in front of
"c:\windows\system32" and "c:\windows". This is because some Windows systems may have
an out-dated copy of JDK/JRE in these directories. Do a search for "java.exe", and you will be
amazed of the findings.
STEP 3: Verify the JDK Installation
Launch a CMD shell (click the "Start" button ⇒ run... ⇒ enter "cmd"), and
1. Issue a "PATH" command to list the search paths for executable programs:
> path
PATH=c:\Program
Files\java\jdk1.6.0_xx\bin;c:\windows\system32;c:\windows;...
Check the output and make sure that $JAVA_HOME\bin is listed in the PATH.
2. Issue the following command to check that JDK is properly installed and display its
version:
The JDK download does not include the documentation, which needs to be downloaded
separately.