如何在 Amazon Linux 2 上安装 jarsigner?

How do I install jarsigner on Amazon Linux 2?

我的理解是 jarsigner 与 OpenJDK 打包在一起,我通过 运行

安装了它
sudo amazon-linux-extras install java-openjdk11

现在我有一堆 jdk 的同义链接,像这样:

$ ll /etc/alternatives/jre*
lrwxrwxrwx 1 root root 60 Feb 16 01:00 /etc/alternatives/jre -> /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.amzn2.0.3.aarch64
lrwxrwxrwx 1 root root 60 Feb 16 01:00 /etc/alternatives/jre_11 -> /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.amzn2.0.3.aarch64
lrwxrwxrwx 1 root root 59 Feb 16 01:00 /etc/alternatives/jre_11_openjdk -> /usr/lib/jvm/jre-11-openjdk-11.0.13.0.8-1.amzn2.0.3.aarch64
lrwxrwxrwx 1 root root 60 Feb 16 01:00 /etc/alternatives/jre_openjdk -> /usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.amzn2.0.3.aarch64

但是,我的bin目录下没有jarsigner:

$ ll /etc/alternatives/jre/bin
total 656
-rwxr-xr-x 1 root root  71368 Dec 17 12:16 alt-java
-rwxr-xr-x 1 root root  71360 Dec 17 12:16 java
-rwxr-xr-x 1 root root  71392 Dec 17 12:16 jjs
-rwxr-xr-x 1 root root  71384 Dec 17 12:16 keytool
-rwxr-xr-x 1 root root  71384 Dec 17 12:16 pack200
-rwxr-xr-x 1 root root  71376 Dec 17 12:16 rmid
-rwxr-xr-x 1 root root  71384 Dec 17 12:16 rmiregistry
-rwxr-xr-x 1 root root 152440 Dec 17 12:16 unpack200

我还需要做什么来安装这个二进制文件?

Amazon 似乎遵循 RedHat 打包方案,将 JRE 和 JDK 分开,就像 Sun/Oracle 过去那样(并且 JRE 拆分为 GUI 和 'headless',对您来说不是问题):

$ yum list 'java-11-openjdk*'
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Installed Packages
java-11-openjdk.x86_64                   1:11.0.13.0.8-1.amzn2.0.3 @amzn2extra-java-openjdk11
java-11-openjdk-headless.x86_64          1:11.0.13.0.8-1.amzn2.0.3 @amzn2extra-java-openjdk11
Available Packages
java-11-openjdk-debug.x86_64             1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-demo.x86_64              1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-demo-debug.x86_64        1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-devel.x86_64             1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-devel-debug.x86_64       1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-headless-debug.x86_64    1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-javadoc.x86_64           1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-javadoc-debug.x86_64     1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-javadoc-zip.x86_64       1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-javadoc-zip-debug.x86_64 1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-jmods.x86_64             1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-jmods-debug.x86_64       1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-src.x86_64               1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-src-debug.x86_64         1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-static-libs.x86_64       1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11
java-11-openjdk-static-libs-debug.x86_64 1:11.0.13.0.8-1.amzn2.0.3 amzn2extra-java-openjdk11

sudo yum install java-11-openjdk-devel应该做。