As of November 2020

you can achieve this in 2 steps:

  1. Install Java 11 using yum:

    yum install java-11-openjdk-devel

  2. Get all the Java configurations available in your machine:

    alternatives --config java

    Run the above command, select the version you want to set, I've set 1 here:

    There are 2 programs which provide 'java'.
    Selection    Command
    
    -----------------------------------------------
       1           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el7_8.x86_64/bin/java)
    *+ 2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java)
    
    Enter to keep the current selection[+], or type selection number: 1
    
  3. Check java -version:

    openjdk version "11.0.8" 2020-07-14 LTS
    OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS)
    OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)
    

Java 11 is now set to be used globally.

Answer from Asad Shakeel on Stack Overflow
🌐
TecAdmin
tecadmin.net › install-oracle-java-11-lts-on-centos
How To Install Java 11 on CentOS 7/6 & RHEL 7/6 - TecAdmin
April 26, 2025 - How to Install Java 11 on CentOS 7/6 & RHEL 7/6. Steps to Install Java 11 on RedHat/CentOS & Fedora system using yum command line.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install java on centos and rocky linux
How to Install Java on CentOS and Rocky Linux
December 16, 2025 - Install Java on CentOS and Rocky Linux with this tutorial. Also, learn to change the default version and set the environment variable.
🌐
Reddit
reddit.com › r/sysadmin › java 11- centos 6
r/sysadmin on Reddit: Java 11- centos 6
December 5, 2018 -

Hey,

OpenJDK 11 ***

We're looking at pushing out Java 11 to around 40 centos 6 servers (upgrades are in the pipeline to be upgraded).

I can see from research you can manually install it by wget the files etc. but they are not available in the repository yet.

On a centos7 box I can yum search and find version 11 in there.

Is there any news on java 11 becoming available for the centos 6 repos?

Thanks in advance.

🌐
IBM
ibm.com › docs › en › qradar-common
Installing Java on RHEL or CentOS Linux - IBM Documentation
December 1, 2025 - Go to IBM Semeru Runtimes Downloads , and download the IBM Semeru Runtime Certified Edition JDK, Version 11 RPM package for Linux® on 64-bit systems. Copy the installation package to your computer or VM where you plan to install the Disconnected ...
Top answer
1 of 2
27

As of November 2020

you can achieve this in 2 steps:

  1. Install Java 11 using yum:

    yum install java-11-openjdk-devel

  2. Get all the Java configurations available in your machine:

    alternatives --config java

    Run the above command, select the version you want to set, I've set 1 here:

    There are 2 programs which provide 'java'.
    Selection    Command
    
    -----------------------------------------------
       1           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el7_8.x86_64/bin/java)
    *+ 2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java)
    
    Enter to keep the current selection[+], or type selection number: 1
    
  3. Check java -version:

    openjdk version "11.0.8" 2020-07-14 LTS
    OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS)
    OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)
    

Java 11 is now set to be used globally.

2 of 2
18

The reason, in short, is because someone has to maintain the packages and put these into the repositories your system is using and verify, that they run stable. For example, the OpenJDK 11 on Debian is still in buster (testing) and sid (unstable) and therefore not available in any stable branch. I guess in CentOS (I am not that familiar with it tbh.) it's the same situation.

Sooner or later you'll have to install software without a manager in any OS, so even if you're saying you're a noob, you'll have to learn that sooner or later. And if you want to use openjdk11 now, you'll have to use either an unofficial repository or install the software by hand, what I'd recommend.

However, here is a guide which is the second hit on Google for openjdk11 centos:

curl -O https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz
tar zxvf openjdk-11.0.1_linux-x64_bin.tar.gz
mv jdk-11.0.1 /usr/local/

vi /etc/profile.d/jdk11.sh

# create new
export JAVA_HOME=/usr/local/jdk-11.0.1
export PATH=$PATH:$JAVA_HOME/bin

source /etc/profile.d/jdk11.sh

java -version

openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

Source: https://www.server-world.info/en/note?os=CentOS_7&p=jdk11&f=2

🌐
ITzGeek
itzgeek.com › home › how to's › linux › centos/redhat › how to install oracle java 12 / 11 / 8 on centos 6 / rhel 6
How To Install Oracle Java 12 / 11 / 8 on CentOS 6 / RHEL 6
April 28, 2019 - ### Oracle Java 12 ### update-alternatives --install /usr/bin/java java /usr/jdk-12.0.1/bin/java 1 ### Oracle Java 11 ### update-alternatives --install /usr/bin/java java /usr/jdk-11.0.3/bin/java 2 ### Oracle Java 8 ### update-alternatives --install /usr/bin/java java /usr/jdk1.8.0_211/bin/java 3
🌐
ComputingForGeeks
computingforgeeks.com › home › centos › install java 11 on centos 7 / fedora 40/39/38/37
Install Java 11 on CentOS 7 / Fedora 40/39/38/37 | ComputingForGeeks
August 2, 2024 - This article will help you to install Oracle Java 11 on CentOS 7 and Fedora. Java 11 is a long-term support (LTS) release.
🌐
DevOpsSchool.com
devopsschool.com › blog › complete-guide-of-java-installation-in-linux
Java Installation Guide in Linux & Windows -
1 DOWNLOAD OPEN JDK & JRE JAVA PACKAGE FROM – https://jdk.java.net/archive/ 2 Download and Install JDK/JRE 7 in Centos & RHEL · 3 Download and Install JDK/JRE 8 in Centos & RHEL · 4 Download and Install JDK/JRE 9 in Centos & RHEL · 5 Download ...
Find elsewhere
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-java-on-centos-and-fedora
How To Install Java on CentOS, Rocky Linux, RHEL, and Fedora | DigitalOcean
March 18, 2022 - This tutorial will show you how to install Java on current versions of RPM-based Linux distributions: Red Hat Enterprise Linux, CentOS, Fedora, and Rocky Lin…
🌐
Liquid Web
liquidweb.com › home › help docs › server administration › linux server administration › installing and verifying openjdk 11
How to Install OpenJDK 11 and Configure with Java | Liquid Web
December 15, 2025 - ======================================================================== Package Architecture Version Repository Size ======================================================================== Installing: Java-11-openjdk-devel x86_64 1:11.0.8.10-0.el8_2 system-AppStream 3.4 M Installing dependencies: … … … ... Enabling module streams: javapackages-runtime 201801 Transaction Summary ======================================================================== Install 63 Packages Total download size: 68 M Installed size: 246 M Is this ok [y/N]: Downloading Packages: (1/63): cups-libs-2.2.6-33.el8.x86_64.rpm 15 MB/s | 432 kB 00:00 (2/63): glib-networking-2.56.1-1.1.el8.x86_64.rpm 9.9 MB/s | 155 kB 00:00 (3/63): gdk-pixbuf2-2.36.12-5.el8.x86_64.rpm 8.9 MB/s | 467 kB 00:00 …
🌐
Medium
medium.com › @prudhviraju.srivatsavaya › installing-openjdk-11-on-centos-using-yum-cadc0276f83a
Installing OpenJDK 11 on CentOS using yum | by Prudhviraju Srivatsavaya | Medium
July 29, 2023 - And if you want to use openjdk11 now, you’ll have to use either an unofficial repository or install the software by hand, what I’d recommend. However, here is a guide which is the second hit on Google for openjdk11 centos: > curl -O https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz > tar zxvf openjdk-11.0.1_linux-x64_bin.tar.gz > mv jdk-11.0.1 /usr/local/ > vi /etc/profile.d/jdk11.sh # Add the below lines to the file export JAVA_HOME=/usr/local/jdk-11.0.1 export PATH=$PATH:$JAVA_HOME/bin > source /etc/profile.d/jdk11.sh > java -version # Java version should display as below openjdk version "11.0.1" 2018-10-16 OpenJDK Runtime Environment 18.9 (build 11.0.1+13) OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
🌐
SysAdminXpert
sysadminxpert.com › home › linux › steps to upgrade java 8 to java 11 on centos 7
Steps To Upgrade Java 8 To Java 11 On CentOS 7 | SysAdminXpert
June 7, 2024 - This method is to follow when you ... versions installed on a server, and now you want to set the default java version. This can be done with the alternative system utility. ... Just enter the number when prompted which will change the default Java version. ... [root@CentOS-7 ~]# sudo alternatives --config java There are 3 programs which provide 'java'. Selection Command ----------------------------------------------- 1 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.221-2.6.18.1.el7....
🌐
InMotion Hosting
inmotionhosting.com › inmotion hosting home › support › product guides › vps hosting › how to install java on centos
How to Install Java on CentOS | InMotion Hosting
January 4, 2024 - Java is required for running some games on your Linux VPS including Minecraft. The object-oriented programming language powers many websites and applications on computers and mobile devices. Below we cover how to: ... You need root access to your linux server on your VPS or Dedicated server to continue. ... The installation process consists of installing OpenJDK, the open source Java implementation which includes Font Renderer, or proprietary Oracle JRE/JDK with Flight Recorder which builds on top of OpenJDK.
🌐
CentOS
wiki.centos.org › HowTos › JavaRuntimeEnvironment
How to install the Java Runtime Environment from Java.com
Download the latest Linux RPM (self-extracting file), currently jre-6u30-linux-i586-rpm.bin, from java.com then as root install and configure the alternatives system and plugins.
🌐
Linuxize
linuxize.com › home › java › how to install java on centos 7
How to Install Java on CentOS 7 | Linuxize
February 24, 2020 - If you have multiple Java versions installed on the server, you can change the default version using the alternatives system utility: ... There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- 1 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.3.7-0.el7_6...
🌐
ARZ Host
arzhost.com › blogs › install-java-11-12-on-centos-7
How To Install Java 11 & 12 On CentOS 7?
October 4, 2023 - This detailed tutorial will demonstrate how to set up Java on CentOS 7. ... How to Install Java 11 & 12 on CentOS 7?
🌐
Server World
server-world.info › en › note
CentOS 7 : Install OpenJDK 11 : Server World
(04) Install Python 3.6 · (05) Install Python 3.8 · (06) Install Django · .NET Core · (01) Install .NET Core 2.0 · (02) Install .NET Core 3.0 · Java · (01) Install JDK 8 · (02) Install OpenJDK 8 · (03) Install JDK 11 · (04) Install OpenJDK 11 · (05) Install Tomcat 8 ·
🌐
TecAdmin
tecadmin.net › install-java-on-centos-8
How to Install Java on CentOS 8 – TecAdmin
April 26, 2025 - Now, use one of the following commands to install the required Java version on your CentOS 8 and RHEL 8 Linux systems. You can also install both Java versions on any system and use them as per your requirements. During the last update of this tutorial Java 1.8, Java 11, Java 17, and Java 19 (latest) version were available for installation.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install java 8 & 11 on centos 8
How to Install Java 8 & 11 on Centos 8
August 4, 2025 - 5. Scroll down and find the gray box labeled Java SE Development Kit 11.0.5. In it, you will find all the available packages for the software. 6. To download any of the packages, you first need to check the box that confirms you Accept License Agreement. 7. For CentOS 8, the Linux x64 .rpm file is a good package choice since it is easier to install...
🌐
Linuxize
linuxize.com › home › java › how to install java on centos 8
How to Install Java on CentOS 8 | Linuxize
February 24, 2020 - If you installed multiple Java versions on your CentOS system, you can use the alternatives system to set which Java version will be used when you type java in the terminal. To check what Java version is set as the default one, type: ... There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- 1 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.4.11-0.el8_0.x86_64/bin/java) *+ 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el8_0.x86_64/jre/bin/java) Enter to keep the current selection[+], or type selection number: