英文:
Yum - what java 8 versions are available to install?
问题
我正在尝试在我的AWS EC2上安装Java 8版本(使用AWS Linux镜像),使用yum命令。每次尝试都告诉我版本不被识别。例如:
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
和
[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
以及
[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
我能够简单地使用以下命令:
sudo yum install java
但是这将安装OpenJDK 17版本。我如何找出通过yum可用的Java 8版本,然后安装其中之一呢?
英文:
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?
答案1
得分: 0
我得到了帮助,并成功安装了我想要的东西。我执行了以下操作:
[ec2-user@ip-172-31-9-107 nifi]$ yum search java | grep "1.8"
上次元数据到期检查:1小时33分钟前,时间为2023年8月8日18:28:56。
java-1.8.0-amazon-corretto.x86_64 : Amazon Corretto运行环境
java-1.8.0-amazon-corretto-devel.x86_64 : Amazon Corretto开发环境
然后执行了以下操作:
sudo yum install java-1.8.0-amazon-corretto.x86_64
这样安装了:
[ec2-user@ip-172-31-9-107 nifi]$ java -version
openjdk version "1.8.0_382"
英文:
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"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论