In Linux and Networking Last updated:
Share on:
Jira Software is the #1 project management tool used by agile teams to plan, track, release, and support great software.

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.

Share on:
  • Chandan Kumar
    Author
    Chandan Kumar is a seasoned technology enthusiast and entrepreneur passionate about empowering businesses and individuals globally. As the founder of Geekflare, a leading technology publication, Chandan has spearheaded the development…

Thanks to our Sponsors

More great readings on Linux

Power Your Business

Some of the tools and services to help your business grow.
  • The text-to-speech tool that uses AI to generate realistic human-like voices.

    Try Murf AI
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.

    Try Brightdata
  • Monday.com is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.

    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.

    Try Intruder