English English French French Spanish Spanish German German
Geekflare is supported by our audience. We may earn affiliate commissions from buying links on this site.
Share on:

How to Upgrade JDK 1.6 to 1.7 on Linux or CentOS?

java
Invicti Web Application Security Scanner – the only solution that delivers automatic verification of vulnerabilities with Proof-Based Scanning™.

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.

Thanks to our Sponsors
More great readings on Linux
Power Your Business
Some of the tools and services to help your business grow.
  • Invicti uses the Proof-Based Scanning™ to automatically verify the identified vulnerabilities and generate actionable results within just hours.
    Try Invicti
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.
    Try Brightdata
  • Semrush is an all-in-one digital marketing solution with more than 50 tools in SEO, social media, and content marketing.
    Try Semrush
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.
    Try Intruder