🌐
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 section will show you how to install the prebuilt OpenJDK JRE and JDK packages using the yum package manager.
🌐
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.
🌐
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.
🌐
Linux Hint
linuxhint.com › centos_install_openjdk
How to Install OpenJDK on CentOS V8 – Linux Hint
CentOS is ideal for programming and when you want to create Java applications, you can utilize its two default Java versions, Java 11 or Java 8, available in its repository. When you install OpenJDK, you can set which Java version to use as your default option, including exporting its path to make it available to applications you build on your CentOS 8.
🌐
Linuxize
linuxize.com › home › java › how to install java on centos 7
How to Install Java on CentOS 7 | Linuxize
February 24, 2020 - This tutorial describes how to install various versions and implementations of Java on CentOS 7. We’ll show you how to install OpenJDK as well as Oracle Java.
🌐
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 - Here, the dnf command is the package manager for CentOS 8. The -y flag automatically answers YES to prompts, streamlining the update process. OpenJDK is a free, open-source implementation of the Java Platform Standard Edition (Java SE).
🌐
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.
🌐
Snapcraft
snapcraft.io › install › openjdk › centos
Install OpenJDK on CentOS using the Snap Store | Snapcraft
September 16, 2025 - Get the latest version of OpenJDK for on CentOS - Current JDK release and early-access builds
🌐
ComputingForGeeks
computingforgeeks.com › home › dev › install java 18 (openjdk 18) on centos/fedora/rocky linux
Install Java 18 (OpenJDK 18) on CentOS/Fedora/Rocky Linux | ComputingForGeeks
May 8, 2023 - JDK 18 is the open-source reference implementation of version 18 of the Java SE Platform as specified by by JSR 388 in the Java Community Process. Install JDK | OpenJDK 18 on your CentOS / Fedora/ Rocky / AlmaLinux system using the next steps.
🌐
Stack Overflow
stackoverflow.com › questions › 77492443 › how-can-i-install-openjdk-13-x-on-centos-7
java - How can I install openjdk 13.x on Centos 7? - Stack Overflow
Installed Packages Name : java-latest-openjdk Arch : x86_64 Epoch : 1 Version : 13.0.2.8 Release : 1.rolling.el7 Size : 573 k Repo : installed From repo : epel Summary : OpenJDK Runtime Environment 13 URL : http://openjdk.java.net/ License : ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C : and zlib and ISC and FTL and RSA Description : The OpenJDK runtime environment.
Find elsewhere
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install java 8 & 11 on centos 8
How to Install Java on CentOS 8 | phoenixNAP KB
August 4, 2025 - OpenJDK is the free, open-source version of Java, available under the GPL v2 license. Oracle JDK is a paid, full-featured, Java software-package. In this guide, learn how to install Java on a CentOS 8 server, including the OpenJDK and the Oracle ...
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

🌐
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 - Install Java on CentOS · Install OpenJDK · Install Oracle JRE/JDK · Check Java Download Version · Uninstall Java · You need root access to your linux server on your VPS or Dedicated server to continue. Table of Contents ·
🌐
Techoral
techoral.com › blog › java › install-openjdk-on-centos.html
Open Jdk - How To Install OpenJDK On Centos Real Quick
March 22, 2026 - $ sudo yum install java-1.8.0-openjdk The java-1.8.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then please install the java-1.8.0-openjdk-deve1 package. To Install OpenJDK 8 Java Development Kit (JDK) - Enter the below command on CentOS command line.
🌐
Linuxize
linuxize.com › home › java › how to install java on centos 8
How to Install Java on CentOS 8 | Linuxize
February 24, 2020 - In this tutorial, we will explain how to install one or more Java (OpenJDK) versions on CentOS 8 and how to set the default Java via alternatives.
🌐
Medium
medium.com › @vivekbugale › install-openjdk-13-in-centos-3b82b42a1a7a
Install OpenJDK 13 in Centos. In this tutorial, we are going to see… | by Vivek Bugale | Medium
February 6, 2020 - Install OpenJDK 13 in Centos In this tutorial, we are going to see how we can install OpenJDK 13, set JAVA_HOME environment variable and set default java version in centos. Let’s start! Install …
🌐
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 - [root@host2 ~]# cat /etc/redhat-release CentOS Linux release 8.2.2004 (Core) [root@host2 ~]# First, we want to locate the available versions of OpenJDK listed in the CentOS 8 repository using the following command.
🌐
TheLinuxCode
thelinuxcode.com › home › how to install openjdk on centos 8
How to Install OpenJDK on CentOS 8 – TheLinuxCode
December 27, 2023 - In this detailed tutorial, let‘s go through the hands-on process of installing and configuring OpenJDK on CentOS!
🌐
Server World
server-world.info › en › note
CentOS Stream 9 : OpenJDK 8 : Install : Server World
This article provides an example of how to install OpenJDK 8 from a package and check its operation on CentOS Stream 9.