Professional Documents
Culture Documents
How To Install Java On Oracle Linux 8 Aqsa Yasin Marielle Sarong
How To Install Java On Oracle Linux 8 Aqsa Yasin Marielle Sarong
Excerpt: There are many Java programs that would run well, but you need to consider whatever
the program needs to be implemented. Hence, this article will guide you on how to specifically
install Java on Oracle Linux 8, along with instructions on how to execute other particular tasks
you can perform.
Permalink: how-to-install-java-on-oracle-linux-8
To install Java on Oracle Linux 8, you have to install the latest JDK from the official release
website. The JDK stands for Java Development Kit, an application of any one of the Micro
Version platforms of the Java Platform published by Oracle Corporation. To install it on your
Oracle Linux 8, you have to follow this article very eagerly.
Prerequisites
Oracle Linux 8 installed on your Virtual Box
Must have root user privileges
Open any installed browser and search for the Java SE Oracle Download website. Click on the
JDK Download to proceed.
There are a lot of RPM packages available on the JDK download page. You have to pick the
Linux x64 RPM Package. Under the Download label, click on the .rpm JDK file to download it.
You will then see the below dialogue box. Checkmark the License Agreement terms and click on
the Download button, followed by the RPM file name, to continue the download.
Another dialogue window will be opened. Pick the Save File option, and hit the OK to continue
the download.
You can see that the download has started. Wait for some time until the download has been
completed.
The downloaded JDK RPM file is now residing in the Downloads folder as cited below.
To check whether your Oracle system has any JDK package installed, use the following
command:
You can also verify the latest version of the default Java version compatible and enabled for
your system, using the command as follows:
$ java -version
$ which java
To check the link file, which is /etc/alternatives/java, you can use the appended command
below:
$ su
Note: It will ask for your root password.
# unlink /etc/alternatives/java
# exit
So, upon checking the version of Java, you will find that there is no such file or directory.
You can also check the file using the following "which” command:
$ which java
Install JDK
To install JDK in Oracle Linux 8, open your Downloads folder, where you have downloaded the
JDK file. Press the Right-key button from the mouse and hit on Open in Terminal. You will then
see that your terminal has been opened. Login as a root user using the following command:
$ su
Using the list command, you can list the RPM file as follows:
$ ls
Finally, you can install the JDK file. You have to use the rpm command, followed by the name of
a file, as cited below:
You will see a long list of directories and folders used by the JDK package.
When you check the version of Java, it will show you the latest version that has just been
installed, as appended below:
$ java -version
You can also check the version of Java only, as cited below:
$ javac –version
Launch Java
To verify whether you installed the JDK kit and if it is working properly, you can use the affixed
command:
$ java
$ javac
When you check the Java link path, where the Java resides, it will show you the same old path.
This means that /usr/bin/java has been replaced by the new JDK 15, as cited below:
$ which java
Check File Path
Now to check the link file details, you have to use the list command, followed by /usr/bin/java
path, as cited below:
$ ls –ltr /usr/bin/java
$ ls –la /etc/alternatives/
Conclusion
We have discussed how to switch to root user in Linux Oracle 8, download RPM JDK file,
remove link for default file path, check repositories and version, install JDK Kit on Oracle Linux
8, and link the default file path. Hopefully, you are now able to do all these particular tasks by
following this guide.