Please follow the steps to install Oracle JDK in CentOS:
1) Identify the download URL of Oracle JDK.

  • Login to Oracle JDK download page:

  • Click on the Download JDK button in the Oracle JDK download page

  • Click and select the “Accept License Agreement” radio button.
  • Mouse over the hyperlink and note down the url:

  • For example, the hyperlink will be something like this:
2) Login to the CentOS using SSH
Execute this command to download the rpm file. Change the url to the result from step 1.
wget –no-cookies –no-check-certificate –header “Cookie:; oraclelicense=accept-securebackup-cookie” “
3) Install Oracle JDK
Execute this command to install Oracle JDK. Change the file name to the rpm file name which is downloaded from step 2.
sudo yum localinstall jdk-8u111-linux-x64.rpm
4) Verify Oracle JDK
Execute this command to verify the Oracle JDK
java -version
The result:
java version “1.8.0_111”
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

Leave a Reply

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