Update to the latest OpenJDK on Amazon Linux

Asked 2 years ago, Updated 2 years ago, 159 views

I am using OpenJDK8 (1.8) on Amazon Linux.
I'm thinking of updating to the latest OpenJDK to address Java vulnerabilities.

However, Java SE8 Update 141 does not exist and cannot be updated.

Java SE7 Update 141 exists.

The environment I checked is as follows.

The latest OpenJDK updates to Amazon Linux yum repository
Will it take time?

  • Amazon Linux AMI release 2016.09
  • amzn-main
  • amzn-updates

$yum check-update | grep java

java-1.7.0-openjdk.x86_641: 1.7.0.141-2.6.10.1.73.amzn1amzn-updates

Thank you for your cooperation.

java linux aws yum

2022-09-30 14:43

1 Answers

Each version has a different package.Try installing the 1.8.0 package.

 sudo yum install java-1.8.0-openjdk

Then, since the two Java's are installed, select alternatives to make it standard.

$sudo alternatives --config java

There are 2 programs which provide 'java'.

  Selection Command
-----------------------------------------------
 + 1/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
*  2/usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java

Enter to keep the current selection [+], or type selection number:2

$ java-version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode)

If you don't need 1.7.0, please delete it.

$sudo yum remove java-1.7.0-openjdk

I didn't understand your question.

You can check yum info java-1.8.0-openjdk for updates.Looking at it now, it seems that 1.8.0.141 has been published. You can update it with the sudo yum update java-1.8.0-openjdk command.

$yum info java-1.8.0-openjdk
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-updates/latest/primary_db | 436kB00:00
Installed Packages
Name —java-1.8.0-openjdk
Arch: x86_64
Epoch:1
Version: 1.8.0.131
Release: 2.b11.30.amzn1
Size: 466k
Repo:installed
From repo: amzn-updates
Summary—OpenJDK Runtime Environment
URL: http://openjdk.java.net/
License—ASL 1.1 and ASL 2.0 and GPL+ and GPLv2 and GPLv2 with exceptions and LGPL+ and LGPLv2 and MPLv1.0 and
            : MPLv1.1 and Public Domain and W3C
Description: The OpenJDK runtime environment.

Available Packages
Name —java-1.8.0-openjdk
Arch: x86_64
Epoch:1
Version: 1.8.0.141
Release: 1.b16.32.amzn1
Size: 238k
Repo: amzn-updates/latest
Summary—OpenJDK Runtime Environment
URL: http://openjdk.java.net/
License—ASL 1.1 and ASL 2.0 and GPL+ and GPLv2 and GPLv2 with exceptions and LGPL+ and LGPLv2 and MPLv1.0 and
            : MPLv1.1 and Public Domain and W3C
Description: The OpenJDK runtime environment.


2022-09-30 14:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.