Issue
In the process of trying out a switch to Amazon Linux 2023 from Centos7 and I am trying to understand my options for Java.
I am currenly running Java 11 openjdk in Centos7. Ideally I'd like to match my old java version as closely as possible. In the past we've had bugs come up due to errantly using Oracle java instead of OpenJDK. So what I really want is OpenJDK, but it's not clear if anyone even builds OpenJDK for AL2023 yet (or ever will?).
The latest amazon corretto java rpm from java-11-amazon-corretto
has version 11.0.20+9-1.amzn2023, which is quite close, but I'd like to minimize my changes if possible.
When I do a dnf search openjdk
I don't get any hits:
[ec2-user@blah ~]$ dnf search openjdk
Amazon Linux 2023 repository 17 MB/s | 14 MB 00:00
Amazon Linux 2023 Kernel Livepatch repository 496 kB/s | 159 kB 00:00
Last metadata expiration check: 0:00:01 ago on Mon Sep 11 20:47:56 2023.
No matches found.
I understand that AL2023 is Fedora-based, but also it doesn't seem like AL2023 is compatible with Fedora packages either (as per https://docs.aws.amazon.com/linux/al2023/ug/relationship-to-fedora.html)
So... is there an openjdk alternative to Amazon Corretto Java? What repo would provide that? If not, is that something that is likely to get created in the future?
Solution
Corretto is a build of OpenJDK. OpenJDK is source code that can be compiled into binaries by anyone. So if you want to install OpenJDK in Amazon Linux 2023, Corretto is a good choice.
Actually, Corretto identifies itself as OpenJDK:
$ sudo dnf install java-21-amazon-corretto
...
$ java --version
openjdk 21.0.1 2023-10-17 LTS
OpenJDK Runtime Environment Corretto-21.0.1.12.1 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Corretto-21.0.1.12.1 (build 21.0.1+12-LTS, mixed mode, sharing)
See also: https://docs.aws.amazon.com/linux/al2023/ug/java.html
Corretto is a build of the Open Java Development Kit (OpenJDK) with long-term support from Amazon.
Historically, AL 2023 has provided extra OpenJDK packages, but they have been removed with release 2022.0.20220810:
In this release, we have removed the remaining openjdk packages, as we have shifted Amazon Linux 2022 to use Amazon Corretto as the JVM in the distribution.
(The comments on the questions already contain lots of helpful information. Adding this answer anyway as a summary with references for future visitors.)
Answered By - Lynax Answer Checked By - Marilyn (WPSolving Volunteer)