Home » Java Basics » 03 - Java Installation and Simple Programs
3

Java Download and Installation

How to download and install a Java Application

  1. Go to the Java SE Downloads page and download the first product - JDK 5.0 Update 9 with Netbeans 5.5 (around 150mb).
Screenshot 3a: Installation
  1. Uninstall any Beta or RC versions using 'Add/Remove Programs' in the control panel
  2. Double click on the downloaded file to run the installer. You will need administrative rights in order to install it. In the JDK installer dialogue, accept the license conditions and choose an appropriate directory for installation. You may change the path but make sure that the final directory has the same name (jdk1.5.0_09).
  3. Once the JDK installer is done, you will see a screen similar to screenshot 3b. Click on the finish button.
Screenshot 3b: Installation Success
Screenshot 3b: Installation Success
  1. Updating the PATH variable allows you to run your applications on the command line without typing a long directory and file path every time. To do this, you will have to set a PATH variable to equal the entire path to jdk1.5.0_09\bin. For example, if you installed Java in the directory 'C:\Program Files\Java\jdk1.5.0_09\bin', this entire path would be the value of the variable you are about to set
  2. Go to the control panel and double click System. Choose the 'Advanced' tab. Click on the Environment Variables button.
  3. Select the System Variable Entry that has "Path" under Variable and hit the "edit" key.
Screenshot 3c: Setting Up the Path on Windows XP
Screenshot 3c: Setting Up the Path on Windows XP
  1. Add the Java path to the right hand side of the string value of the existing "Path" next to the "Variable Value" after an initial semicolon (all strings in this variable are separated by semicolons)(Do not replace the existing path). The path variable should indicate the exact location of the 'bin' directory for your JDK installation. Click the 'OK' button.
  2. If a path already exists for another version of JDK in the semicolon separated list of Paths in the "Path" variable, remove it or the new path will be ignored.
  3. Once you exit, click "run" from the "start" menu. Type "cmd" in the pop-up. A window with a prompt will open. At the prompt, type "path" and hit return. You should see the path you just added in the string that appears.
  4. You are now ready to start using Java. Following is a diagram from Java.sun.com that reflects the structure of the JDK installation directories:
                 jdk1.5.0_<version>
____________________|___________________
|    |    |    |    |   |     |      |   |
|    |    |    |   bin lib    |    demo  |
|    |    | LICENSE |   |     |         jre
|    | COPYRIGHT              |        __|__
|  README.txt              include    |     |
readme.html                           bin   lib
  1. Next, go to the Java SE Downloads page and download the J2SE 5.0 Documentation (about 45mb). This is just a zip file. Double-click on it and extract the contents to a folder. Make sure the "Use Folder Names" check box in the extract dialogue is checked before you extract.