JDK (Java Development Kit) Tutorials
Dr. Herong Yang, Version 5.00

Downloading and Installing JDK 1.6.2 on Windows

This section provides a tutorial example on how to download and install JDK 1.6.2 (Java SE 1.6 Update 2) on a Windows XP system. A simple Java program was entered, compiled, and executed with the new JDK installation.

Downloading and installing JDK 1.6.2 (Java SE 1.6 Update 2) on a Windows system is easy. Here is what I did on my Windows XP system in year 2008:

  • Open the Java SE Download page with this URL: http://java.sun.com/javase/downloads/.
  • Click the download button next to "JDK 6u2". You will see a new page with a list of different download files of JDK 6u2.
  • Locate the "Windows Platform - Java(TM) SE Development Kit 6 Update 2" section.
  • Click the hyper link of "Windows Offline Installation (build 06), Multi-language", which links to jdk-6u2-windows-i586-p.exe with size of 65.57 MB.
  • Save jdk-6u2-windows-i586-p.exe to a temporary directory.
  • Double-click on jdk-6u2-windows-i586-p.exe to start the installation wizard.
  • The installation wizard will guide you to finish the installation.

To test the installation, open a command window to try the java command. If you are getting the following output, your installation was ok:

C:\>\progra~1\java\jdk1.6.0_02\bin\java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, 
sharing)

Once JDK is installed, you can try to use it to compile and execute a simple Java program:

1. Use Notepad to enter the following Java program into a file called Hello.java:

class Hello {
   public static void main(String[] a) {
      System.out.println("Hello world!"); 	
   }
}

2. Then compile this program in a command window with the javac command:

progra~1\java\jdk1.6.0_02\bin\javac Hello.java

3. To execute the program, use the java command:

progra~1\java\jdk1.6.0_02\bin\java -cp . Hello
Hello world!

Congratulations, you have successfully entered, compiled and executed your first Java program with JDK 1.6.2.

Dr. Herong Yang, updated in 2008
Downloading and Installing JDK 1.6.2 on Windows