Install Oracle Java 8 in Red Hat Enterprise Linux and AWS EC2

This post demonstrates how to install Java (JDK) 8 in Red Hat Enterprise Linux in AWS EC2.


  • AWS Account
  • Email address
  • Provisioned EC2 instance with Red Hat Enterprise Linux AMI
  • Putty

Before proceeding, we need to perform the following steps:

Provision an EC2 Instance

This post will aid us in creating our server on AWS.

Provision a Server (EC2) on AWS

Convert .pem files to.pkk for putty

Convert the PEM files to a PPK files using PuttyGen

Installing Java (JDK) 8

Step 1: Install wget

Check if wget is already installed.

If not, install it.

Use the following command:

When the installation completes, we’ll have this:

Step 2: Download JDK from Oracle

At the time of writing, the latest version of Java is 1.8.0_144. The following command will download that version of JDK to our EC2.

When the download completes, we’ll have this:

Step 3: Extract and Copy to /opt

Use the following command to extract the contents of the .gz file.

Then copy the extracted directory to /opt directory

Step 4: Add, or Update Symbolic Links

For java (executable):

For other executables or binaries.