Install Oracle JDK 8 on Linux

Install Oracle JDK 8 on CentOS, very Easy and verified Steps :

  1. Install Oracle JDK 8 on CentOS

2.1 Install with yum localinstall.
login to the server with your username and password and then follow :

$ sudo yum localinstall jdk-8u102-linux-x64.rpm






jdk1.8.0_102.x86_64 2000:1.8.0_102-fcs



2.2 Now the JDK should be installed at /usr/java/jdk1.8.0_102$ cd /usr/java

$ ls -lsah

total 12K

4.0K drwxr-xr-x   3 root root 4.0K Jul 21 09:58 ./

4.0K drwxr-xr-x. 15 root root 4.0K Jun 22 22:00 ../

0 lrwxrwxrwx   1 root root   16 Jul 21 09:58 default -> /usr/java/latest/

4.0K drwxr-xr-x   9 root root 4.0K Jul 21 09:58 jdk1.8.0_102/

0 lrwxrwxrwx   1 root root   22 Jul 21 09:58 latest -> /usr/java/jdk1.8.0_102/

2.3 Verification

$ java -version

java version “1.8.0_102”

Java(TM) SE Runtime Environment (build 1.8.0_102-b14)

Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

2.4 Delete the RPM file

$ rm ~/jdk-8u102-linux-x64.rpm

Done. Oracle JDK 8 is installed on CentOS successfully.

  1. JAVA_HOME Environment Variables

This is good practice to set the JAVA_HOME environment variable. It is recommended that we do it .


3.1 Edit the .bash_profile, and append the export JAVA_HOME at the end of the file, for example :


# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc



# User specific environment and startup programs


export JAVA_HOME=/usr/java/jdk1.8.0_102/

export JRE_HOME=/usr/java/jdk1.8.0_102/jre




export PATH

3.2 Test the $JAVA_HOME and $PATH

$ source .bash_profile


$ echo $JRE_HOME



$ echo $JAVA_HOME



$ echo $PATH





This will install JAVA Oracle JDK on Centos. Install Tomcat with CGI Perl 


                     Android Not getting Detected in Ubuntu Systems


Leave a Reply

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

Translate »
[huge_it_videogallery id="2"]