• Get application security done the right way! Detect, Protect, Monitor, Accelerate, and more…
  • There were many of you asked so thought to put things together.

    In this article, I will talk about how to upgrade JDK (Java Development Kit) from 1.6 to 1.7 on Red Hat Linux or CentOS.

    This would assume you have root permission and JDK 1.6 or lower version already installed. 

    • Let’s verify the java version installed on the server.
    [~] #java -version
    java version "1.6.0_24"
    OpenJDK Runtime Environment (IcedTea6 1.11.11.90) (rhel-1.62.1.11.11.90.el6_4-x86_64)
    OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
    [~] #
    • Download JDK 1.7 from Oracle Download Page  and upload to server in /tmp area
    • Install downloaded JDK1.7 RPM by using rpm –ivh command
    [/tmp] #rpm -ivh jdk-7u60-linux-x64.rpm
    Preparing...       ########################################### [100%]
    1:jdk           ########################################### [100%]
    Unpacking
    JAR files...
    rt.jar...
    jsse.jar...
    charsets.jar...
    tools.jar...
    localedata.jar...
    jfxrt.jar...
    [/tmp] #
    • JDK 1.7 is installed now and ready to use. By default, it’s installed under /usr/java directory.
    [/usr/java] #ls -ltr
    total 4
    drwxr-xr-x. 8 root root 4096 Jul  1 15:14 jdk1.7.0_60
    lrwxrwxrwx. 1 root root   21 Jul  1 15:14 latest -> /usr/java/jdk1.7.0_60
    lrwxrwxrwx. 1 root root   16 Jul  1 15:14 default -> /usr/java/latest [/usr/java]
    #
    • Now you can set /usr/java/jdk1.7.0_60 to JAVA_HOME environment variable to use JDK 1.7
    • Let’s verify the JAVA version now.
    [~] #java -version
    java version "1.7.0_60" Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
    Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
    [~] #

    I hope this quick guide helps you in upgrading JDK on Linux platform.