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 “C:\Program Files\java\jdk1.6.0_14” and “C:\Program Files\java\jre6”, respectively. For novices, accept the defaults. I shall refer to the JDK installed directory as
In this Section we will add some settings to the windows environment so that the java compiler and runtime becomes available for compiling and running the java application.
The JAVA_HOME will be your installation directory. In my case, C:\Program Files\Java\jdk1.6.0_14. Either you can set up this as Windows environment, in which case you never need to worry about setting up of the JAVA_HOME, but makes it little difficult to use any other JDK version. Or, you can create a batch file for that particular project, to have unique environments for that project alone.
Right clicking “My Computer” icon generally available on your Desktop or Windows Start -> My Computer -> View System Information Set up Java Home Properties -> Advanced -> Environment Variables -> System variables -> New
Variable Name: JAVA_HOME Variable Value: C:\Program Files\Java\jdk1.6.0_14
Note: The variable value is your JDK installation directory name. The above is as on my system.
In “Variable value” field, INSERT “%JAVA_HOME%\bin” (assume that this is your JDK’s binary directory) IN FRONT of all the existing directories, followed by a semi-colon (;) which separates the JDK’s binary directory from the rest of the existing directories. DO NOT DELETE any existing entries; otherwise, some existing applications may not run.
Variable name : PATH Variable value : %JAVA_HOME%\bin;….exiting entries….
Launch a CMD shell (click the “Start” button ⇒ run… ⇒ enter “cmd”), and Issue a “path” command to list the content of the PATH environment variable. Check the output and make sure that
prompt> path PATH=c:\Program Files\java\jdk1.7.0\bin;......other entries......
Issue the following commands to verify that JDK is properly installed and display its version:
prompt> java -version java version "1.7.0" Java(TM) SE Runtime Environment (build 1.7.0-b147) Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing) prompt> javac Usage: javac <options> <source files> ......... .........
The JDK download does not include the documentation, which needs to be downloaded separately.You should have a local copy of JDK API Documentation.