In this guide,we will look at how you can install Java 11 on Oracle Linux 8. Java is a widely adopted programming Language in businesses and personal projects alike. The latest version of Java available on Oracle Linux 8 repository is Java 11. In this post, we will install OpenJDK 11 on Oracle Linux 8.

OpenJDK is an open-source implementation of the Java Platform, Standard Edition licensed under the GNU General Public License version 2. The Oracle Linux 8 AppStream repository contains the OpenJDK binaries from a fully open source set of build scripts and infrastructure.

Install Java 11 (OpenJDK 11) on Oracle Linux 8

Update your Oracle Linux machine to ensure you’re working with the latest releases of packages.

sudo dnf update

If you’re okay with the updates to be pushed to the system, accept with the y key.

Last metadata expiration check: 1:51:00 ago on Mon 11 May 2020 03:14:46 PM UTC.
Dependencies resolved.
 Package                                   Architecture             Version                                  Repository                           Size
 gnutls                                    x86_64                   3.6.8-10.el8_2                           ol8_baseos_latest                   915 k
 iproute                                   x86_64                   5.4.0-1.0.1.el8                          ol8_UEKR6                           665 k
 oraclelinux-release                       x86_64                   8:8.2-1.0.8.el8                          ol8_baseos_latest                    66 k
 selinux-policy                            noarch                   3.14.3-41.0.1.el8_2.2                    ol8_baseos_latest                   615 k
 selinux-policy-targeted                   noarch                   3.14.3-41.0.1.el8_2.2                    ol8_baseos_latest                    15 M
 systemd                                   x86_64                   239-30.0.1.el8_2                         ol8_baseos_latest                   3.5 M
 systemd-libs                              x86_64                   239-30.0.1.el8_2                         ol8_baseos_latest                   1.1 M
 systemd-pam                               x86_64                   239-30.0.1.el8_2                         ol8_baseos_latest                   450 k
 systemd-udev                              x86_64                   239-30.0.1.el8_2                         ol8_baseos_latest                   1.3 M
 tzdata                                    noarch                   2020a-1.el8                              ol8_baseos_latest                   469 k
 xfsprogs                                  x86_64                   5.4.0-1.el8                              ol8_UEKR6                           1.1 M

Transaction Summary
Upgrade  11 Packages

Total download size: 25 M
Is this ok [y/N]: y

You can consider rebooting the system if there were kernel updates.

sudo systemctl reboot

You can get a list of Java 11 related packages on Oracle Linux 11 using the command below.

$ sudo yum search java-11-openjdk
Last metadata expiration check: 2:03:03 ago on Mon 11 May 2020 03:14:46 PM UTC.
======================================================== Name Exactly Matched: java-11-openjdk ========================================================
java-11-openjdk.src : OpenJDK Runtime Environment 11
java-11-openjdk.x86_64 : OpenJDK Runtime Environment 11
============================================================ Name Matched: java-11-openjdk ============================================================
java-11-openjdk-src.x86_64 : OpenJDK Source Bundle 11
java-11-openjdk-demo.x86_64 : OpenJDK Demos 11
java-11-openjdk-jmods.x86_64 : JMods for OpenJDK 11
java-11-openjdk-devel.x86_64 : OpenJDK Development Environment 11
java-11-openjdk-javadoc.x86_64 : OpenJDK 11 API documentation
java-11-openjdk-headless.x86_64 : OpenJDK Headless Runtime Environment 11
java-11-openjdk-javadoc-zip.x86_64 : OpenJDK 11 API documentation compressed in single archive

We will install java-11-openjdk package.

sudo dnf install java-11-openjdk

Dependency tree will be resolved automatically for you.

Dependencies resolved.
 Package                                 Architecture          Version                                          Repository                        Size
 java-11-openjdk                         x86_64                1:                              ol8_appstream                    247 k
Installing dependencies:
 alsa-lib                                x86_64                                          ol8_appstream                    441 k
 copy-jdk-configs                        noarch                3.7-1.el8                                        ol8_appstream                     27 k
 giflib                                  x86_64                5.1.4-3.el8                                      ol8_appstream                     51 k
 java-11-openjdk-headless                x86_64                1:                              ol8_appstream                     40 M
 javapackages-filesystem                 noarch                5.3.0-1.module+el8+5136+7ff78f74                 ol8_appstream                     30 k
 lcms2                                   x86_64                2.9-2.el8                                        ol8_appstream                    164 k
 libXcomposite                           x86_64                0.4.4-14.el8                                     ol8_appstream                     28 k
 libXi                                   x86_64                1.7.9-7.el8                                      ol8_appstream                     49 k
 libXtst                                 x86_64                1.2.3-7.el8                                      ol8_appstream                     22 k
 libfontenc                              x86_64                1.1.3-8.el8                                      ol8_appstream                     37 k
 libjpeg-turbo                           x86_64                1.5.3-10.el8                                     ol8_appstream                    155 k
 lksctp-tools                            x86_64                1.0.18-3.el8                                     ol8_baseos_latest                100 k
 lua                                     x86_64                5.3.4-11.el8                                     ol8_appstream                    193 k
 ttmkfdir                                x86_64                3.0.9-54.el8                                     ol8_appstream                     62 k
 tzdata-java                             noarch                2020a-1.el8                                      ol8_appstream                    189 k
 xorg-x11-font-utils                     x86_64                1:7.5-40.el8                                     ol8_appstream                    103 k
 xorg-x11-fonts-Type1                    noarch                7.5-19.el8                                       ol8_appstream                    522 k
Enabling module streams:
 javapackages-runtime                                          201801                                                                                 

Transaction Summary
Install  18 Packages

Total download size: 42 M
Installed size: 187 M
Is this ok [y/N]: y

Confirm Java 11 (OpenJDK 11) on Oracle Linux 8

Validate that Java was installed successfully on your Oracle Linux 8 machine.

$ java --version
openjdk 11.0.7 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)

Write a test HelloWorld java application.

cat > <<EOF
public class helloworld {
  public static void main(String[] args) {
    System.out.println("Hello Java World from Kenya!");

Execute the application.

$ java
Hello Java World from Kenya!

Yey!.. Seems Java 11 has been installed successfully on our Oracle Linux 8 system. Our next guide will cover installation of Java 8 on Oracle Linux 8.

Installation of Java on other Linux system.

Install Java 11 on CentOS / RHEL 8