Install Java 11 (OpenJDK 11) on Oracle Linux 8

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.

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

We will install java-11-openjdk package.

sudo dnf install java-11-openjdk

Dependency tree will be resolved automatically for you.

....
Transaction Summary
==========================================================================================================================================================================================================
Install  169 Packages

Total download size: 117 M
Installed size: 442 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 version "11.0.25" 2024-10-15 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS, mixed mode, sharing)

Write a test HelloWorld java application.

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

Execute the application.

$ java Hello_World.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.

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

The web browser is the key arsenal that we use to browse the internet. If you want to access information […]

The adoption of Containers and microservice architectures has been amazing and speedy in the past few years. Docker is widely […]

Docker is a platform for building, deploying, and shipping containerized applications. A container packages an application with all its dependencies […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.