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
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

🌐
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.
Discussions

Cent OS 7 (EOL) how to install Java 1:11.0.0 for 4.8
1st off, I love CentOS but I am original Mac/PC user so I only use Unix on a few servers. Still very much learning each time I deploy or use it. I know I need to replace CentOS and going with Rocky but until that new deployment I need Openfire to work. Trying to update to 4.8 and I get this ... More on discourse.igniterealtime.org
🌐 discourse.igniterealtime.org
0
0
March 1, 2024
CentOS 8 + Java 11
Platform information: Hardware: Raspberry Pi 4B (ARM64) / 4G RAM OS: CentOS 8 (64-bits) I purchased a Raspberry Pi 4 to replace my old Pi3B with OpenHABian; however, I’m having issues to install Java 11. I’m aware from the prerequisites (Installation Overview | openHAB) that I Zulu is the ... More on community.openhab.org
🌐 community.openhab.org
0
0
October 13, 2021
rhel - Can I use centOS and Redhat's JDK-11 altogether in my production server - Unix & Linux Stack Exchange
Our current server is based on CentOS 7 and Oracle JDK-8 and wants to migrate some sort of free JDK11 solutions with LTS support for our production server. I've not found any option to download or install redhat's openJDK-11 in cent-os. I can't even install it in RHEL-server without subscription. Is there any licencing problem if I use cent-OS and redhat-openJDK-11? ... The licensing part is the lesser of your problems. Retro compatibility in supporting java ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
Java 11- centos 6

If your looking for a RPM from redhat you might be out of luck with 6.

https://access.redhat.com/articles/1299013#OpenJDK_Lifecycle_Dates_and_RHEL_versions

More on reddit.com
🌐 r/sysadmin
4
4
December 5, 2018
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_build_of_openjdk › 11 › html-single › installing_and_using_red_hat_build_of_openjdk_11_on_rhel › index
Installing and using Red Hat build of OpenJDK 11 on RHEL | Red Hat build of OpenJDK | 11 | Red Hat Documentation
You can install Red Hat build of OpenJDK Java Runtime Environment (JRE) using the system package manager, yum. ... Logged in as a user with root privileges on the system. Registered your local system to your Red Hat Subscription Management account. See the Registering a system using Red Hat ...
🌐
Ignite Realtime
discourse.igniterealtime.org › openfire
Cent OS 7 (EOL) how to install Java 1:11.0.0 for 4.8 - Openfire - Ignite Realtime Community Forums
March 1, 2024 - 1st off, I love CentOS but I am original Mac/PC user so I only use Unix on a few servers. Still very much learning each time I deploy or use it. I know I need to replace CentOS and going with Rocky but until that new deployment I need Openfire to work. Trying to update to 4.8 and I get this ...
🌐
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.
🌐
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 Linux.
🌐
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 ...
Find elsewhere
🌐
Medium
medium.com › @redswitches › how-to-install-java-on-centos-8-c1c946730a8a
Step-by-Step Guide to Installing Java (OpenJDK) on CentOS 8
September 19, 2024 - CentOS 8 offers an official OpenJDK 11 package in its official repositories. ... You have successfully installed OpenJDK 11 if the output displays the installed version. Many developers consider installing both Java 8 and Java 11 an advantage.
🌐
Linode
linode.com › docs › guides › how-to-install-openjdk-on-centos-8
How To Install Java Development Kit 11 on CentOS 8 | Linode Docs
March 25, 2020 - This guide will show you how to install the free and open-source Open Java Development Kit (OpenJDK) version of the Java Runtime Environment (JRE) on CentOS 8.
🌐
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 - First, we want to locate the available versions of OpenJDK listed in the CentOS 8 repository using the following command. [root@host2 ~]# dnf search jdk Last metadata expiration check: 0:02:37 ago on Fri Aug 21 15:09:18 2020. ========== Name & Summary Matched: jdk ========== java-11-openjdk-demo.x86_64 : OpenJDK Demos 11 java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos 8 java-11-openjdk-jmods.x86_64 : JMods for OpenJDK 11 java-11-openjdk-src.x86_64 : OpenJDK Source Bundle 11 java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle 8 java-11-openjdk.x86_64 : OpenJDK Runtime Environment 11 copy-jdk-c
🌐
openHAB Community
community.openhab.org › setup, configuration and use › installation
CentOS 8 + Java 11 - Installation - openHAB Community
October 13, 2021 - Platform information: Hardware: Raspberry Pi 4B (ARM64) / 4G RAM OS: CentOS 8 (64-bits) I purchased a Raspberry Pi 4 to replace my old Pi3B with OpenHABian; however, I’m having issues to install Java 11. I’m aware from the prerequisites (Installation Overview | openHAB) that I Zulu is the recommended version and I should not install the 64-bit Java version, even though my OS is 64-bits.
🌐
GitHub
gist.github.com › caffeinetiger › 7c2e72bf28f6b87216a3218114d3ff20
References: - [Install Java 11 (OpenJDK 11) on RHEL 8|CentOS 8|Rocky Linux 8](https://computingforgeeks.com/how-to-install-java-11-openjdk-11-on-rhel-8/) · GitHub
References: - [Install Java 11 (OpenJDK 11) on RHEL 8|CentOS 8|Rocky Linux 8](https://computingforgeeks.com/how-to-install-java-11-openjdk-11-on-rhel-8/) - install_oracle_jdk_11.sh
🌐
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)
🌐
OpenJDK
openjdk.org › install
OpenJDK: Download and install
The java-1.7.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.7.0-openjdk-devel package.
🌐
Reintech
reintech.io › blog › install-java-centos-9
How to Install Java on CentOS 9 | Reintech media
March 8, 2026 - CentOS 9 uses the alternatives system to manage which version is active: # Install both versions sudo dnf install java-11-openjdk-devel java-17-openjdk-devel -y # Check installed versions sudo alternatives --config java
🌐
Server World
server-world.info › en › note
CentOS 7 : Install OpenJDK 11 : Server World
October 17, 2018 - Java · (01) Install JDK 8 · (02) Install OpenJDK 8 · (03) Install JDK 11 · (04) Install OpenJDK 11 · (05) Install Tomcat 8 · (06) Install Tomcat 9 · Desktop Environment · (10) Connect to Windows with RDP · (09) VNC Client : noVNC · (08) VNC Server ·
🌐
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.

🌐
CloudSigma
blog.cloudsigma.com › home › customers › installing java on centos and fedora
Installing Java on CentOS and Fedora • CloudSigma
June 14, 2022 - To install the Java package on CentOS, run the following command: To install the Java package on Fedora, run the following command: Check out the Oracle JDK 11 download page. Then, download the RPM package. It is now time to install the package.