Install and Manage Java Packages on CentOS

This section provides a tutorial example on how to install OpenJDK 11 JRE (Java Runtime Environment) on CentOS 8 systems using 'dnf/yum' as the package manager.

If you want to run Java applications on CentOS Linux systems, you can follow what I did on my CentOS 8 computer:

1. Login as "herong", who has admin privileges.

2. Run "dnf search" to find available Java packages. I see OpenJDK 1.8 and OpenJDK 11 packages available for installation:

herong$ dnf search java

java-11-openjdk.x86_64 : OpenJDK Runtime Environment 11
java-11-openjdk-src.x86_64 : OpenJDK Source Bundle 11
java-11-openjdk-demo.x86_64 : OpenJDK Demos 11
java-11-openjdk-devel.x86_64 : OpenJDK Development Environment 11
java-11-openjdk-jmods.x86_64 : JMods for OpenJDK 11
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment 8
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle 8
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos 8
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment 8
java-1.8.0-openjdk-javadoc.noarch : OpenJDK 8 API documentation
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Headless Runtime Environment 8
...

3. Install the OpenJDK 11 JRE (Java Runtime Environment):

herong$ sudo dnf install java-11-openjdk

Dependencies resolved.
 Package                    Architecture  Version
============================================================
Installing:
 java-11-openjdk            x86_64        1:11.0.6.10-0.el8_1
Installing dependencies:
 copy-jdk-configs           noarch        3.7-1.el8
 java-11-openjdk-headless   x86_64        1:11.0.6.10-0.el8_1
 javapackages-filesystem    noarch        5.3.0-1.module_el8.0.0+11...
 ttmkfdir                   x86_64        3.0.9-54.el8
 tzdata-java                noarch        2019c-1.el8
 xorg-x11-fonts-Type1       noarch        7.5-19.el8
 lksctp-tools               x86_64        1.0.18-3.el8
Enabling module streams:
 javapackages-runtime                     201801

...
Installed:
  java-11-openjdk-1:11.0.6.10-0.el8_1.x86_64
  copy-jdk-configs-3.7-1.el8.noarch
  java-11-openjdk-headless-1:11.0.6.10-0.el8_1.x86_64
  javapackages-filesystem-5.3.0-1.module_el8.0.0
  ttmkfdir-3.0.9-54.el8.x86_64
  tzdata-java-2019c-1.el8.noarch
  xorg-x11-fonts-Type1-7.5-19.el8.noarch
  lksctp-tools-1.0.18-3.el8.x86_64

Complete!

3. Verify OpenJDK 11 JRE (Java Runtime Environment):

herong$ java -version

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

Cool! I have installed OpenJDK 11 JRE on my CentOS computer without any issues.

Table of Contents

 About This Book

 Introduction to Linux Systems

 Cockpit - Web Portal for Administrator

 Process Management

 Files and Directories

 Users and Groups

 File Systems

 Block Devices and Partitions

 LVM (Logical Volume Manager)

 Installing CentOS

 SELinux - Security-Enhanced Linux

 Network Connection on CentOS

 Internet Networking Tools

 SSH Protocol and ssh/scp Commands

Software Package Manager on CentOS - DNF and YUM

 What Is DNF

 Manage DNF Package Repositories

 What Is YUM

 What Is RPM

 What Is pkgs.org

Install and Manage Java Packages on CentOS

 Install and Manage Perl Packages on CentOS

 Install "git-core" for GitHub Packages on CentOS

 Failed to Download Metadata for Repo ...

 Replacing CentOS Repositories to Local Mirrors

 vsftpd - Very Secure FTP Daemon

 LDAP (Lightweight Directory Access Protocol)

 Administrative Tasks

 References

 Full Version in PDF/EPUB