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. There were many of you asked so thought to put things together.

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 environment. Let me know if you experience any issue while upgrading.

Reader Interactions

Comments

  1. How to do this from terminal?
    I need to install jdk 1.7 on my centos vm running over mac…
    tried the steps from other sites…dint work… (tar cmd gives error)
    Any help is much appreciated.

  2. Hi,

    We are having Linux 64 bit OS,which is having now java JDK 1.6 version,in the server we have Informatica lifecyle mangement 6.1 version using that jdk 1.6,we are planning to do updates of ILM 6.2 version for that we need to update the JDK 1.6 to JDK 1.7 version.

    Could you please let me know how i need to instal this JDK 1.7 in my linux sever.

    Thanks,
    Bussireddy Jayachandra.

Comments

Your email address will not be published. Required fields are marked *