The installation of a JDK is something required during the installation of many Oracle products. It is sometimes included with some of them but I wanted to have a standalone installation from the official Oracle RPM instead of having to use an existing one. I have documented all the steps in this page in case you need to do it too.

The first step was to download the proper JDK package from Oracle Java Downloads website. I chose the x64 RPM Linux Package because I wanted to install the RPM in an existing Oracle Linux 8.5 VM.

I had downloaded the RPM using the host computer so I copied the file in the folder I had previously configured as the shared folder between the host and the VM. This folder was available as “/media/sf_SharedFolder/” in the VM machine. I logged in as root and I used the “cd /media/sf_SharedFolder/” command to change the current directory to this folder.

Them I used the “yum -y localinstall jdk-18_linux-x64_bin.rpm” command to install the package with yum:

The installation started…

And it completed successfully after a few tens of seconds:

I executed the command “which java” to identify the java executable location and it was a link to “/etc/alternatives/java” that resulted being an other link to “/usr/java/jdk-18.0.1/bin/java“.

The JDK was therefore installed in “/usr/java/jdk-18.0.1“, I took a note of the path in case I would have to use it in further software installations. As you can see, the installation Oracle’s JDK was pretty straightforward and presented no difficulties.
Disclaimer
The post How to install Oracle JDK RPM in Oracle Linux 8.5 appeared first on MyBIJourney