How to install Java?

Follow the below steps to install Java in your machine:
  • Step 1: Goto Oracle site and download the JDK installer as shown below:
  • Step 2: Once the download button is clicked, it will take you to select operating system and other specs: [Note: Select  jdk-7-windows-i586.exe for Windows 32 bit and jdk-7-windows-x64.exe for Windows 64 bit]
  • Step 3: Once the download is complete, double click the installer to start the installation.

  • Step 4: Once the installation is complete, verify whether Java folder is created under program files. You could find JDK inside Java folder.
  • Step 5: You are yet to set the environment variables for JAVA_HOME and PATH.
    • Step 5.1: How to set Environment variable for JAVA_HOME:
      • For Windows xp: 
        1. Goto Start >> Control Panel >> System >> Advanced
        2. Click on 'Environment Variables', under System variables find JAVA_HOME and double click on itRefer
        3. If you couldn't find one, create new variable, click on NEW  button under System Variables. Enter 'JAVA_HOME' as Variable name and Enter JDK Installed path[C:\Program Files\Java\jdk1.7.0] as Variable Value
        4. Click OK.
      • For Windows 7:
        1. Goto Start >> Control Panel >> System and Security >> System >> Advanced system settings
        2. Follow the same steps given above.
    • Step 5.2: How to set Environment variable for PATH:
      • For Windows xp: 
        1. Goto Start >> Control Panel >> System >> Advanced
        2. Click on 'Environment Variables', under System variables find PATH and double click it. Refer
          1. Add variable value with installed  \JAVA\JDK 1.7.x\BIN direcoty path [Say C:\Program Files\Java\jdk1.7.0\bin]. [Don't change the already existing paths, If you do so, programs that are running already need to be installed again]
          2. Make sure each different paths value should be separated with semicolon as shown below:
          3. C:\Program Files (x86)\MySQL\MySQL Server 4.1\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files\Java\jdk1.7.0\bin;
          4. You are done with setting environment variable for Java PATH.
          5. Click Ok.
        3. If you couldn't find PATH variable, create new variable, click on NEW  button under System Variables. Enter 'PATH' as Variable name and Enter BIN directory path as Variable Value
        4. Click OK.
      • For Windows 7:
        1. Goto Start >> Control Panel >> System and Security >> System >> Advanced system settings
        2. Follow the same steps given above.


  • Set JAVA_HOME:



  • Set PATH: