Install Open JDK 8 on CentOS 7.4

0

I have an Ec2 instance running CentOS 7.4.1 and I'm trying to install open JDK 8 onto it. This is the command I'm using to install Java:

sudo yum install java-1.8.0-openjdk-devel

It produces the following:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package java-1.8.0-openjdk-devel available.
Error: Nothing to do

This site contains a list of the different rpm packages that are available for each distribution, CentOS 7.4 is not listed which leads me to believe that, that's why the above method did not work. Is it possible to install Open JDK 8 onto CentOS 7.4?

Chris

Posted 2019-05-03T14:30:47.483

Reputation: 1

Can you please check that it is not excluded in /etc/yum.conf? Also please add the output of yum list java-1.8.0-openjdk* to your question. – Aulis Ronkainen – 2019-05-03T19:00:27.473

I had checked the yum.conf prior but didn't specify in the post as I believed the issue was related to the actual java-1.8.0-openjdk-devel package. I found a solution. – Chris – 2019-05-07T16:29:31.623

Answers

0

The Repository needed to be enable first before open JDK 8 could be installed.

sudo yum update
sudo yum repolist all

Check the repo id ultra-centos-7.x-openjdk exists.

sudo yum-config-manager --enable ultra-centos-7.x-openjdk
sudo yum install java-1.8.0-openjdk-devel

Confirm the installation using -

java -version

Chris

Posted 2019-05-03T14:30:47.483

Reputation: 1