Hotfix To Install Latest Oracle JDK On Linux EC2 Instance (CentOS)


In this blog we will explore the procedure to install latest java 8 version ie JDK 8u121 (released on 17th January, 2017) on the EC2 Linux instance which comes with centOS as its default operating system. Following steps must be followed sequentially :

Step 1 -> Ssh to your instance

Refer Step 4 of this blog to ssh to your instance.

Step 2 -> Check the Java version

java -version

before_java

As can be seen in the image above, java 7 is installed on the EC2 instance by default. We will now be updating to java 8.

Step 3 -> Download RPM package of Oracle JDK (8u121)

 wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.rpm

download_java

NOTE -> It is important to manually instruct wget to send the cookie and here this is done using

–header “Cookie: oraclelicense=accept-securebackup-cookie”

where oraclelicense is the name of the cookie and accept-securebackup-cookie is its value.

Step 4 -> Install JDK 8

sudo yum install -y jdk-8u121-linux-x64.rpm

Step 5 -> Verify oracle JDK version

java -version

java_after
The java version is now updated. You may now delete jdk-8u121-linux-x64.rpm file.

Hope the blog helps you. Questions are welcomed.

References ->

  1. https://www.mkyong.com/java/how-to-install-oracle-jdk-8-on-centos/
  2. https://www.gnu.org/software/wget/manual/wget.html

 


KNOLDUS-advt-sticker

This entry was posted in Scala. Bookmark the permalink.

2 Responses to Hotfix To Install Latest Oracle JDK On Linux EC2 Instance (CentOS)

  1. Pingback: Deploying a 2 node Elasticsearch cluster on ec2 instance. | Knoldus

  2. Pingback: Installing and running Kafka on AWS instance (CentOS) | Knoldus

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s