Getting Started with Amazon Corretto: Production Ready Distribution of OpenJDK

In November 2018, James Gosling (who now works at Amazon), father of Java released Corretto at Devoxx Belgium conference. Amazon Corretto is no-cost, multi platform, production ready distribution of OpenJDK. This comes at a time when Oracle announced that it will no longer provide free binary downloads of JDK after a six-month period; and neither it will patch OpenJDK with fixes after that period. The six-month is the new release cycle for new JDK versions. If you follow Java, then you might be aware that Java has moved to six month release cycle. The latest version of JDK is 12.

Amazon is a heavy user of Java so it made sense for them to get involved with OpenJDK. Amazon has provided multiple bug fixes and security patches to OpenJDK 8. By releasing Amazon Corretto as an open-source project, they are providing a production ready, long term support JDK variant to the community. Java is heavily used by enterprises so Amazon Corretto will help enterprises to embrace new versions of JDK at their pace.

The upstream project for Corretto will be OpenJDK. So, all the bug fixes and security patches will happen in OpenJDK. Amazon will run TCK on each release to ensure that Corretto is compatible with Java SE. Amazon plans to release quarterly updates.

Corretto is available on all major operating systems – Windows, Macintosh, and Linux. It is a drop in replacement for all Java SE distributions. Amazon will distribute security updates to Corretto 8 at no cost until at least June, 2023, and to Corretto 11 until at least August, 2024.

What’s the difference between OpenJDK and Amazon Corretto?

OpenJDK hosts the source code for Java. It does not provide binary distributions. As developers, we use binaries provided by different parties like Red Hat, Oracle, and others. Corretto is downstream project of OpenJDK. It tests and packages OpenJDK so that it can be used by developers. With Corretto, Amazon has the freedom to release distributions as per their needs.

Corretto is a drop-in replacement. You will not feel any difference.

Installing and running Amazon Corretto on your machine

You can download the package for your operating system from the following link.

If you use Docker, you can build the Docker image using the following command.

$ docker build -t amazon-corretto-8   

It will take few minutes to build the image. This uses base image of Amazon Linux. You can list your docker images as shown below.

docker images|grep corretto
amazon-corretto-8                                              latest              ea7f815a5609        2 minutes ago       487MB

You can now run your Docker container and check the version of Java

$ docker run -it amazon-corretto-8 /bin/bash

Once inside the bash shell, you can check Java version as shown below.

$ java -version
bash-4.2# java -version
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (build 1.8.0_192-amazon-corretto-preview-b12)
OpenJDK 64-Bit Server VM (build 25.192-b12, mixed mode)

As you can see the build number is build 1.8.0_192-amazon-corretto-preview-b12.

Corretto with jaba: Java Version Manager

Managing multiple JDK versions on your development machine is not easy. jaba is Java version manager to work with multiple versions. It makes it easy to switch JDK versions. Once jaba is installed on your machine, you can use it to install and manage various JDK distributions and versions.

Corretto is currently not supported because Corretto does not yet provide tar.gz/ZIP archives. As mentioned in the issue on Corretto Github issue tracker, Amazon will provide archives with Corretto GA. So, we will have to wait till then.

Corretto timeline

  • Corretto 8(OpenJDK 8) general availability is planned for Q1 2019. There will be distributions for Ubuntu and Red Hat enterprise linux
  • Corretto 11(Open JDK 11) will be available by April 2019

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: