javajarsigneramazon-linux-2

How do I install jarsigner on Amazon Linux 2?


My understanding is that jarsigner is packaged with OpenJDK, which I've installed by running

sudo amazon-linux-extras install java-openjdk11

Now I have a bunch of synlinks to the jdk, like so:

$ 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

However, I don't have jarsigner in the bin directory:

$ 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

What else do I need to do to install this binary?


Solution

  • It appears Amazon follows the RedHat packaging scheme with JRE and JDK separated, as Sun/Oracle used to (and the JRE split into GUI and 'headless', not an issue for you):

    $ 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 should do it.