2.6.2. Oracle JDK 7 update 40

Use the following instructions to manually install JDK 7:

  1. Check the version. From a terminal window, type:

    java -version
  2. (Optional) Uninstall the Java package if the JDK version is less than 7.

    rpm -qa | grep java
    yum remove {java-1.*}
  3. (Optional) Verify that the default Java package is uninstalled.

    which java
  4. Download the Oracle 64-bit JDK (jdk-7u40-linux-x64.tar.gz) from the Oracle download site. From your browser window, go to http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.

    Accept the license agreement and download jdk-7u40-linux-x64.tar.gz to a temporary directory ($JDK_download_directory).

  5. Change directory to the location where you downloaded the JDK and run the install.

    mkdir /usr/jdk1.7.0_40
    cd /usr/jdk1.7.0_40
    chmod u+x $JDK_download_directory/jdk-7u40-linux-x64.bin
    ./$JDK_download_directory/jdk-7u40-linux-x64.bin
    
  6. Create symbolic links (symlinks) to the JDK.

    mkdir /usr/java
    ln -s /usr/jdk1.7.0_40/jdk1.7.0_40 /usr/java/default
    ln -s /usr/java/default/bin/java /usr/bin/java
    
  7. Set up your environment to define JAVA_HOME to put the Java Virtual Machine and the Java compiler on your path.

    export JAVA_HOME=/usr/java/default
    export PATH=$JAVA_HOME/bin:$PATH
    
  8. Verify if Java is installed in your environment. Execute the following from the command line console:

    java -version

    You should see the following output:

    java version "1.7.0_40"
    Java(TM) SE Runtime Environment (build 1.7.0_40-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)


loading table of contents...