2.6.3. OpenJDK 7

Use the following instructions to manually install OpenJDK 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 OpenJDK 7 RPMs. From the command-line, run:

    yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
  5. Create symbolic links (symlinks) to the JDK.

    mkdir /usr/java
    ln -s /usr/openjdk1.7.0/openjdk1.7.0 /usr/java/default
    ln -s /usr/java/default/bin/java /usr/bin/java
    
  6. 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
    
  7. Verify if Java is installed in your environment. Execute the following from the command-line console:

    java -version

    You should see output similar to the following:

    openjdk version "1.7.0"
    OpenJDK Runtime Environment (build 1.7.0)
    OpenJDK Client VM (build 20.6-b01, mixed mode)


loading table of contents...