Issue
I am attempting to install java version 8 on my AWS EC2 (uses AWS linux image) using yum. Each attempt is telling me the version is not recognized. For instance:
ec2-user@ip-172-31-9-107 nifi]$ sudo yum install java-1.8.0-openjdk-devel
Last metadata expiration check: 1:46:16 ago on Tue Aug 8 17:09:37 2023.
No match for argument: java-1.8.0-openjdk-devel
Error: Unable to find a match: java-1.8.0-openjdk-devel
,and
[ec2-user@ip-172-31-9-107 nifi]$ sudo yum install java-1.8.0-openjdk.x86_64
Last metadata expiration check: 1:47:09 ago on Tue Aug 8 17:09:37 2023.
No match for argument: java-1.8.0-openjdk.x86_64
Error: Unable to find a match: java-1.8.0-openjdk.x86_64
,and
[ec2-user@ip-172-31-9-107 nifi]$ sudo sudo yum install java-1.8.0-openjdk
Last metadata expiration check: 1:48:39 ago on Tue Aug 8 17:09:37 2023.
No match for argument: java-1.8.0-openjdk
Error: Unable to find a match: java-1.8.0-openjdk
I was able to simply use:
sudo yum install java
,but that installed openjdk version 17. How can I figure out what java 8 versions are available via yum and then install one of them?
Solution
I got an assist and was able to install what I wanted. I did:
[ec2-user@ip-172-31-9-107 nifi]$ yum search java | grep "1.8"
Last metadata expiration check: 1:00:33 ago on Tue Aug 8 18:28:56 2023.
java-1.8.0-amazon-corretto.x86_64 : Amazon Corretto runtime environment
java-1.8.0-amazon-corretto-devel.x86_64 : Amazon Corretto development environment
,and then:
sudo yum install java-1.8.0-amazon-corretto.x86_64
which installed:
[ec2-user@ip-172-31-9-107 nifi]$ java -version
openjdk version "1.8.0_382"
Answered By - Timothy Clotworthy Answer Checked By - Cary Denson (WPSolving Admin)