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

AlmaLinux or RockyLinux are enterprise Linux working techniques and excellent decisions for internet hosting or operating server functions. They are free and open supply, so anybody can use them to arrange their Linux infrastructure. However, the default Java obtainable by 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 straight utilizing the DNF package deal supervisor of Almalinux or Rocky as a result of it’s not current there, therefore, go to the official web site and obtain the JDK or JRE 8 no matter you wish 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’ve 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 positioned and run:

Syntax:

sudo chmod a+x file-name

Example”

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

Step 3: Install Oracle JDK 8 on Almalinux or RockyLinux

Once you’ve made the recordsdata 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 verify, whether or not the model of Java you’ve put in is in your system or not, we will use the given command.

java -version

However, you probably have 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, you probably have a number of model together with Oracle Java 8 then to configure it because the system vast 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 even ask you which of them model of it you wish to be the default. Enter the Selection quantity and hit the enter key.

Similary, these wish to change the Java Compiler – Javac as nicely 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 fully 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 Build Tools on AlmaLinux or RockyLinux 8/9

Previous article

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

Next article

You may also like

Comments

Leave a Reply

More in Almalinux