如何在 AWS ec2 实例上升级到 Java SE 开发工具包 9.0.1?

如何在 AWS ec2 实例上升级到 Java SE 开发工具包 9.0.1?

尝试过

[ec2-user@server ~]$ sudo yum install java-1.9.0
Loaded plugins: priorities, update-motd, upgrade-helper
No package java-1.9.0 available.
Error: Nothing to do

我检查了包裹,但没有找到

[ec2-user@server ~]$ sudo yum list java*
Loaded plugins: priorities, update-motd, upgrade-helper
Installed Packages
java-1.8.0-openjdk.x86_64   1:1.8.0.151-1.b12.35.amzn1  @amzn-updates
java-1.8.0-openjdk-devel.x86_64 1:1.8.0.151-1.b12.35.amzn1  @amzn-updates
java-1.8.0-openjdk-headless.x86_64  1:1.8.0.151-1.b12.35.amzn1  @amzn-updates
javapackages-tools.noarch   0.9.1-1.5.amzn1 installed
Available   Packages
java-1.6.0-openjdk.x86_64   1:1.6.0.41-1.13.13.1.77.amzn1   amzn-main
java-1.6.0-openjdk-demo.x86_64  1:1.6.0.41-1.13.13.1.77.amzn1   amzn-main
java-1.6.0-openjdk-devel.x86_64 1:1.6.0.41-1.13.13.1.77.amzn1   amzn-main
java-1.6.0-openjdk-javadoc.x86_64   1:1.6.0.41-1.13.13.1.77.amzn1   amzn-main
java-1.6.0-openjdk-src.x86_64   1:1.6.0.41-1.13.13.1.77.amzn1   amzn-main
java-1.7.0-openjdk.x86_64   1:1.7.0.151-2.6.11.0.74.amzn1   amzn-main
java-1.7.0-openjdk-demo.x86_64  1:1.7.0.151-2.6.11.0.74.amzn1   amzn-main
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.151-2.6.11.0.74.amzn1   amzn-main
java-1.7.0-openjdk-javadoc.noarch   1:1.7.0.151-2.6.11.0.74.amzn1   amzn-main
java-1.7.0-openjdk-src.x86_64   1:1.7.0.151-2.6.11.0.74.amzn1   amzn-main
java-1.8.0-openjdk-demo.x86_64  1:1.8.0.151-1.b12.35.amzn1  amzn-updates
java-1.8.0-openjdk-javadoc.noarch   1:1.8.0.151-1.b12.35.amzn1  amzn-updates
java-1.8.0-openjdk-javadoc-zip.noarch   1:1.8.0.151-1.b12.35.amzn1  amzn-updates
java-1.8.0-openjdk-src.x86_64   1:1.8.0.151-1.b12.35.amzn1  amzn-updates
java_cup.noarch 1:0.10k-5.7.amzn1   amzn-main
java_cup-javadoc.noarch 1:0.10k-5.7.amzn1   amzn-main
java_cup-manual.noarch  1:0.10k-5.7.amzn1   amzn-main
javacc.noarch   4.1-0.5.8.amzn1 amzn-main
javacc-demo.noarch  4.1-0.5.8.amzn1 amzn-main
javacc-manual.noarch    4.1-0.5.8.amzn1 amzn-main
javassist.noarch    3.9.0-6.4.amzn1 amzn-main
javassist-javadoc.noarch    3.9.0-6.4.amzn1 amzn-main

有没有办法通过 yum 安装它?

答案1

您可以直接从Oracle下载RPM包并通过yum安装。

转至下载页面http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html 并使用链接到 RPM 包:

wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.rpm
sudo yum install jdk-9.0.1_linux-x64_bin.rpm

相关内容