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
🌐
SysAdminXpert
sysadminxpert.com › home › linux › how to install openjdk 11 on centos 7
How To Install OpenJDK 11 On CentOS 7 | SysAdminXpert
January 4, 2024 - In this tutorial, you will learn how to install OpenJDK 11 on CentOS 7. Oracle JDK includes compiler but compiler for OpenJDK 11 is included in openjdk-devel. OpenJDK is an open-source implementation of the Java Platform, OpenJDK comes under ...
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

🌐
Server World
server-world.info › en › note
CentOS 7 : Install OpenJDK 11 : Server World
(05) Install PHP 7.3 · Python · (01) Install Python 3.3 · (02) Install Python 3.4 · (03) Install Python 3.5 · (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 ·
🌐
CyberITHub
cyberithub.com › openjdk-installation-on-centos-7
OpenJDK Installation on CentOS 7 with Easy Steps | CyberITHub
December 26, 2021 - OpenJDK is the official reference implementation of Java SE since version 7. OpenJDK Installation on CentOS 7 is fairly easy and straightforward. Also Read: How to Install Docker Compose on Ubuntu 20.04 LTS [Step by Step] [root@localhost ~]# ...
🌐
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 - java -version openjdk version "11.0.14.1" 2022-02-08 OpenJDK Runtime Environment 18.9 (build 11.0.14.1+1) OpenJDK 64-Bit Server VM 18.9 (build 11.0.14.1+1, mixed mode, sharing) $ ... Download the latest release of JDK 11. curl -L -b "oraclelicense=a" -O https://download.oracle.com/otn-pub/java/jdk/11.0.14+8/7e5bbbfffe8b45e59d52a96aacab2f04/jdk-11.0.14_linux-x64_bin.rpm
🌐
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 - java -version openjdk version "11.0.4" 2019-07-16 LTS OpenJDK Runtime Environment 18.9 (build 11.0.4+11-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.4+11-LTS, mixed mode, sharing) ... Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp ... if i export environment variable to the /ect/environment in centos 7 vi,ls etc commands are not working and unable to enter into the system after reboot ... 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.
🌐
Linuxize
linuxize.com › home › java › how to install java on centos 7
How to Install Java on CentOS 7 | Linuxize
February 24, 2020 - Before starting with the tutorial, make sure you are logged in as root or user with sudo privileges . OpenJDK, the open-source implementation of the Java Platform, is the default Java development and runtime in CentOS 7.
🌐
OVHcloud
ovhcloud.com › home › tutorials › how to install java on centos 7
How to install Java on Centos 7 ? | OVHcloud Worldwide
In this tutorial you will learn how to install a Java Development Kit (JDK) on the Centos 7 Linux distribution.
🌐
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 - The following sections provide steps to install OpenJDK, OpenJRE, and Oracle Java on a CentOS or Rocky Linux system.
Find elsewhere
🌐
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 - Set the default Java Compiler alternatives to use Java 11: ... Choose the version corresponding to OpenJDK 11. ... [root@CentOS-7 ~]# java -version openjdk version "11.0.7" 2020-04-14 LTS OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS) ...
🌐
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 - 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)
🌐
Linux Hint
linuxhint.com › install_oracle_jdk11_centos7
Install Oracle JDK 11 on CentOS 7 – Linux Hint
In this article, I will show you how to install Oracle JDK 11 on CentOS 7. The latest LTS (Long Term Support) version of JDK (Java Development Kit) is version 11 which came out recently. JDK 8 and JDK 11 are the only officially supported versions of JDK at the time of this writing.
🌐
Ignite Realtime
discourse.igniterealtime.org › openfire
Openjdk version on centos 7 - Openfire - Ignite Realtime Community Forums
November 27, 2023 - I’m trying to upgrade openfire 4.7.5 to 4.8.0 beta on a CentOS 7 server but it says I need a newer openjdk version. I currently have 1.8.0 but it needs 1.11.0. I tried installing java-11-openjdk-devel (and java -version shows “openjdk version 11.0.21”) but it still says it needs 1.11.
🌐
Stack Overflow
stackoverflow.com › questions › 55854978 › install-android-sdk-in-centos-7
centos7 - Install Android SDK in Centos 7 - Stack Overflow
you need to extract android tool then install platform tools and then configure environemnt path. yum install java-1.8.0-openjdk-devel · mkdir -p /opt/android-sdk-linux · cd /opt/android-sdk-linux · wget --output-document=android-sdk.zip ...
🌐
Linode
linode.com › docs › guides › install-java-on-centos
Install Java on Centos 7 | Linode Docs
June 1, 2017 - Java is a powerful programming language. Software written in Java can compile and run on any system. Unlike Python or C, Java does not come pre-installed on Linode distribution images. This guide installs the OpenJDK 8 runtime environment and development kit in CentOS 7.
🌐
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 - … … Verifying : tzdata-java-2020a-1.el8.noarch 61/63 Verifying : xorg-x11-font-utils-1:7.5-40.el8.x86_64 62/63 Verifying : xorg-x11-fonts-Type1-7.5-19.el8.noarch 63/63 Installed: java-11-openjdk-1:11.0.8.10-0.el8_2.x86_64 java-11-openjdk-devel-1:11.0.8.10-0.el8_2.x86_64 java-11-openjdk-headless-1:11.0.8.10-0.el8_2.x86_64 javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch Complete!