• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install Java 11 on CentOS 7/6 & Fedora 29-25

Written by Rahul, Updated on February 6, 2019
JAVA java, Java 11, Java 11 LTS, java-install

The Oracle team has discontinued the security updates for Java 8. Also released the latest Java 11 LTS version. Java 11 has been released for general availability with the many featured enhancements. You can read the details here. This article will help you to install Oracle Java 11 on CentOS 7/6, RHEL 7/6 and Fedora 29/28/27/26/25 system.

Step 1 – Download Java 11

Download the latest Java SE Development Kit 11 LTS release from its official download page or use following commands to download from command line.

wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie"   "http://download.oracle.com/otn-pub/java/jdk/11.0.2+9/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_linux-x64_bin.rpm"

Step 2 – Install Java 11

After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package.

yum localinstall jdk-11.0.2_linux-x64_bin.rpm    ### CentOS systems 
dnf localinstall jdk-11.0.2_linux-x64_bin.rpm    ### Fedora systems 
alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
 + 1           /opt/jdk1.8.0_201/bin/java
*  2           /usr/java/jdk-11.0.2/bin/java

Enter to keep the current selection[+], or type selection number: 2 

According to the above screenshot, there are 3 versions installed. Java 11 is listed on number 2, So input numeric 2 and press Enter. Now Java 11 is configured as default Java on my CentOS and Fedora system.

Step 3 – Check Java Version

Check the installed Java version on your system using the following command.

java -version

java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

Step 4 – Setup Java Environment Variables

Most of the Java-based applications uses environment variables to work. Set the Java environment variables using following commands

  • Setup JAVA_HOME Variable
  • export JAVA_HOME=/usr/java/jdk-11.0.2
    
  • Setup PATH Variable
  • export PATH=$PATH:/usr/java/jdk-11.0.2/bin
    

Also put all above environment variables in /etc/environment file for auto loading on system boot.

Share it!
Share on Facebook
Share on Twitter
Share on Google+
Share on Reddit
Share on Tumblr
Rahul
Rahul
Connect on Facebook Connect on Twitter Connect on Google+

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Related Posts

  • How to Install Oracle Java 11 on Ubuntu 16.04 LTS (Xenial)

    October 7, 2018
  • How to Install Oracle Java 11 on Debian 9 (Stretch)

    October 1, 2018
  • How to Install Oracle Java 11 on Ubuntu 18.04 LTS (Bionic)

    September 30, 2018
  • How to Switch Between Multiple Java Versions on Ubuntu 18.04 & 16.04

    September 5, 2018
  • How to Switch Between Multiple Java Versions on Debian 9/8

    September 5, 2018

6 Comments

  1. meenal deshpande Reply to meenal
    October 18, 2018 at 6:42 am

    Java is a programming language which is used in lots of places in today’s world from android apps to commercial e-commerce website from financial applications to scientific tools, games, electronic trading devices and other desktop applications similar to IntelliJ, Eclipse, Netbeans from an open source library to J2ME apps.
    Thanks for sharing the article.

  2. Dominik Reply to Dominik
    October 10, 2018 at 8:39 am

    Thank you!!!

  3. ktkim Reply to ktkim
    March 6, 2018 at 8:59 am

    Thank you for useful contents

  4. mahendra Reply to mahendra
    February 20, 2018 at 6:12 am

    hi bro it is not working and my system commands not working after installation of java

  5. mahendra Reply to mahendra
    February 19, 2018 at 2:32 pm

    thanks, but it is not saving in proper way in pdf.

  6. Sameer Reply to Sameer
    February 14, 2018 at 6:49 pm

    Thank you rahul. It was useful information.

Leave a Reply

Cancel reply

Popular Posts

  • How To Install Zabbix Agent on Debian 9/8
  • How to Install and Configure Squid Proxy on Debian 9
  • How To Install Wine 3 on Debian 9 (Stretch)
  • How to Remove “public/index.php” from URL in Laravel
  • How to Install Swift on Ubuntu 18.04 LTS
All rights reserved. © 2013-2018 TecAdmin.net. This site uses cookies. By using this website you agree our term and services