Techolac - Computer Technology News
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games
No Result
View All Result
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games
No Result
View All Result
Techolac - Computer Technology News
No Result
View All Result
Home Linux

How to Install Java 8 JRE and JDK from RPM file on Linux

by Editorial Staff
July 5, 2019
in Linux
Reading Time: 3 mins read

JRE stands for Java Runtime Environment.

JDK stands for Java Development Kit.

In most situations, if you want to run a Java application, you just need to install Only JRE.

But, if you are doing some development work, or compiling an application that requires Java SDK, then you have to install JDK.

This tutorial explains how to install JRE only, JDK only, and both JRE JDK together.

Download Java 8 JRE Only

The latest version of Java 8 is available for download from here. Click on the “Download” link next to “JRE”.

Here is the direct download link for JRE 8 Download.

Click on the radio-button that says: “Accept License Agreement”. The radio button will disappear and you’ll see this message: Thank you for accepting the Oracle Binary Code License Agreement for Java SE; you may now download this software.

For 64-bit linux, download the jre-8u131-linux-x64.rpm file, which is under “Linux x64”

for 32-bit linux, download the jre-8u131-linux-i586.rpm file, which is under “Linux x86”

Install Java 8 JRE Only

On this server, currently there is no java installed.

# java -version
-bash: java: command not found

# rpm -qa | grep -i jre

Install the downloaded jre rpm file as shown below.

# rpm -ivh jre-8u131-linux-x64.rpm --test
Preparing...                          ################# [100%]

# rpm -ivh jre-8u131-linux-x64.rpm 
Preparing...                          ################# [100%]
Updating / installing...
   1:jre1.8.0_131-1.8.0_131-fcs       ################# [100%]
Unpacking JAR files...
        plugin.jar...
        javaws.jar...
        deploy.jar...
        rt.jar...
        jsse.jar...
        charsets.jar...
        localedata.jar...

Verify to make sure it is installed successfully. In this example, as we see, this has installed the 1.8.0 version of java.

# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

# rpm -qa | grep -i jre
jre1.8.0_131-1.8.0_131-fcs.x86_64

Note: If you are new to Java, and like to learn how to write a simple basic hello world java program, this might help: How To Write and Execute Java Program on Unix OS

Download Java 8 JDK Only

If you are installing JDK, you typically don’t have to install JRE separately as all the binary files that are included with JRE is also included with JDK.

See also  Rocket.Chat: How To Install The Messaging System on Debian 9

The latest version of Java 8 is available for download from here. Click on the “Download” link next to “JDK”.

Here is the direct download link for JDK 8 Download.

Click on the radio-button that says: “Accept License Agreement”. The radio button will disappear and you’ll see this message: Thank you for accepting the Oracle Binary Code License Agreement for Java SE; you may now download this software.

For 64-bit linux, download the jdk-8u131-linux-x64.rpm file, which is under “Linux x64”

for 32-bit linux, download the jdk-8u131-linux-i586.rpm file, which is under “Linux x86”

Install Java 8 JDK Only

Install the Java 8 JDK on your system as shown below.

# rpm -ivh jdk-8u131-linux-x64.rpm --test
Preparing...                          ################ [100%]
 
# rpm -ivh jdk-8u131-linux-x64.rpm 
Preparing...                          ################ [100%]
Updating / installing...
   1:jdk1.8.0_131-2000:1.8.0_131-fcs  ################ [100%]
Unpacking JAR files...
        tools.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...
        rt.jar...
        jsse.jar...
        charsets.jar...
        localedata.jar...

Make sure that the jdk rpm is successfully installed.

# rpm -qa | grep -i jdk
jdk1.8.0_131-1.8.0_131-fcs.x86_64

Java 8 JRE and JDK File Locations

By default, the above steps will install both jre and jdk under /usr/java directory as shown below.

# ls -l /usr/java/
lrwxrwxrwx. 1 root root   16 Jun  1 16:55 default -> /usr/java/latest
drwxr-xr-x. 9 root root 4096 Jun  1 17:03 jdk1.8.0_131
drwxr-xr-x. 7 root root 4096 Jun  1 16:55 jre1.8.0_131
lrwxrwxrwx. 1 root root   22 Jun  1 17:03 latest -> /usr/java/jdk1.8.0_131

The above ls output indicates that you can install multiple versions of jre or jdk on the same machine, as each and every version of the installation will get its own directory name with the version number in it.

The java executable is used from the JRE location (and not from JDK location).

When you have multiple java installed, to identify which version of the java executable is used system-wide, do the following:

As shown below, the java executable is pointing to /usr/bin/java

# whereis java
java: /usr/bin/java /usr/share/man/man1/java.1

The /usr/bin/java is really pointing to the java in /etc/alternatives directory.

# ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 22 Jun  1 17:03 /usr/bin/java -> /etc/alternatives/java

Finally, as you see here, the etc alternatives java is pointing to the java executable from the Java 8 JRE that we installed. (i.e from /usr/java/jre1.8.0_131/bin directory)

# ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 31 Jun  1 17:03 /etc/alternatives/java -> /usr/java/jre1.8.0_131/bin/java

 

See also  How to override content type with Nginx web server

Related Posts

Top Commands to Check the Running Processes in Linux
Linux

Top Commands to Check the Running Processes in Linux

May 27, 2022
4 Tips to Prevent and Troubleshoot the ImagePullBackOff Kubernetes Error
Linux

4 Tips to Prevent and Troubleshoot the ImagePullBackOff Kubernetes Error

March 30, 2022
How Common Signals are Used in Kubernetes Pod Management
Linux

How Common Signals are Used in Kubernetes Pod Management

November 20, 2021

Leave a Reply Cancel reply

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

30 Cinecalidad Alternatives To Watch Movies And TV Shows Online

30 Cinecalidad Alternatives To Watch Movies And TV Shows Online

August 16, 2022
Venafi

Top 15 Best Venafi Alternatives In 2022

August 16, 2022
Want Less Risk When Trading Crypto? Use Derivatives

Want Less Risk When Trading Crypto? Use Derivatives

August 16, 2022
virtual reality agencies

Top 15 Virtual Reality Agencies In 2022

August 15, 2022
30 LookMovie Alternatives To Watch Movies And TV Shows Online

30 LookMovie Alternatives To Watch Movies And TV Shows Online

August 15, 2022
  • DashTech
  • TechDaddy
  • Terms and Conditions
  • Disclaimer
  • Write for us

© Techolac © Copyright 2019 - 2022, All Rights Reserved.

No Result
View All Result
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games

© Techolac © Copyright 2019 - 2022, All Rights Reserved.

Go to mobile version