The Right Way to Install Oracle Java 8 on AlmaLinux or RockyLinux 8/9 10

AlmaLinux or RockyLinux are enterprise Linux working techniques and ideal decisions for internet hosting or working server functions. They are free and open supply, so anybody can use them to arrange their Linux infrastructure. However, the default Java out there via their repositories is OpenJDK which is an open-source version of Oracle Java. Therefore, for many who are on the lookout for instructions for putting in Oracle Java model 8 which is long-term supported both on Almalinux or Rocky Linux 8/9, then on this tutorial, we learn to try this.

Step 1: Download Oracle Java 8

We can’t get Oracle Java 8 immediately utilizing the DNF package deal supervisor of Almalinux or Rocky as a result of it isn’t current there, therefore, go to the official web site and obtain the JDK or JRE 8 no matter you need to install as per your system structure (x64 or x86). Here, we’re downloading the 64-bit model.

Download Java 8 oracle for Almalinux

Step 2: Change file Permission to execute it

Once you might have downloaded the file and it’s on the system, let’s change its permission to execute and install Java 8 with none drawback.

Switch to the listing the place the file is situated and run:


sudo chmod a+x file-name


sudo chmod a+x jdk-8u*-linux-x64.rpm

Step 3: Install Oracle JDK 8 on Almalinux or RockyLinux

Once you might have made the information executable, use the RPM command to install the JDK or JRE 8 on the system.

sudo rpm -ivh jdk-8u*-linux-x64.rpm
Installing Orcale Java 8 on Almalinux or Rocky

Step 4: Check Version

To affirm, whether or not the model of Java you might have put in is in your system or not, we will use the given command.

java -version

However, when you’ve got a number of variations of Java put in then the most recent and default one will seem in the results of the above command. Hence, to make the Oracle Java 8 your system’s default model,if not already, observe the following step.

Step 5: Update Alternatives

Updat the Alternatives to set the default model of Java as per your venture. For instance, when you’ve got a number of model together with Oracle Java 8 then to configure it because the system huge default use the given command:

sudo update-alternatives --config java

The above command will listing the put in variations of Java in your Linux system. It may also ask you which ones model of it you need to be the default. Enter the Selection quantity and hit the enter key.

Similary, these need to change the Java Compiler – Javac as effectively can use the next command:

sudo update-alternatives --config javac
Change the default version of Java in Almalinux or Rocky

Uninstallating Java, if required

If there are circumstances, whenever you don’t require Oracle Java 8 in your system then to utterly take away it from AlmaLinux or Rocky, run the given command:

sudo dnf take away jdk-1.8
remove Oracle Java 8

Other Articles:

The Right Way to Install Oralce Java 8 on AlmaLinux or RockyLinux 8/9

Previous article

The Right Way to Install Mosh on AlmaLinux or Rocky Linux 9/8

Next article

You may also like


Leave a Reply

More in Almalinux