Amazon Corretto: Another OpenJDK

DZone 's Guide to

Amazon Corretto: Another OpenJDK

Check out the latest, no-cost JDK from Amazon.

· Java Zone ·
Free Resource

Amazon Corretto, a no-cost distribution of the OpenJDK, is the new OpenJDK distribution from Amazon.

This is really great news for Java developers. Amazon has released blog post with the following text that explains their reasoning for releasing Corretto:

“Amazon has a long and deep history with Java. I’m thrilled to see the work of our internal mission-critical Java team being made available to the rest of the world” — James Gosling

Amazon Corretto is a no cost, multiplatform, production-ready open JDK distribution. It comes with long-term support, including performance enhancements and security fixes. Amazon is using Corretto internally in production on thousands of services. This means that it has been fully tested. Corretto is certified as compatible with the Java SE standard and is used internally at Amazon for many production services. With Corretto, you can develop and run Java applications on operating systems, such as Amazon Linux 2, Windows, and macOS. In response to AWS Linux’s long-term support for Java, AWS recently released the free OpenJDK Amazon Corretto to ensure that cloud users can get stable support and secure the operation of Java workloads. To ensure compatibility, Arun Gupta, AWS’s chief open-source technologist, said that every time Amazon Corretto is released, the development team will implement the TCK (Technology Compatibility Kit) to ensure that the component is compatible with the Java SE platform.

On Twitter, Gupta said that the workload of Amazon’s internal formal environment also relies heavily on Amazon Corretto’s JDK to meet high performance and large-scale demand. Amazon Corretto can support multiple heterogeneous environments, including the cloud, local data centers, and user development environments. In addition, to expand the scope of application of developers, the platform supported by Amazon Corretto at this stage includes Amazon Linux 2, Windows, macOS, and Docker image files. The official version of Amazon Corretto is expected to be released in the first quarter of 2019 and will be compatible with Ubuntu and Red Hat Enterprise Linux.

The JDK is now available for free download by open users, and AWS also promises that Amazon Corretto version 8 free security updates will be available at least until June 2023, while Amazon Corretto version 11 free updates will continue until August 2024.

This is just a developer preview release if you are a developer go ahead and make your hands dirty with this one.


  • Backed by Amazon
  • Production-ready
  • Multiplatform Support: Linux, Windows, Osx, and Docker containers
  • No cost

You can find the source code for Corretto on GitHub. Additionally, you can find the Official Documentation here and download the preview link.

How to Install on macOS

The following applies to Mac operating system versions 10.10 or later. You must have administrator privileges to install and uninstall Amazon Corretto 8.

Download amazon-corretto-jdk-8u192-macosx-x64.pkg.

  1. Double-click the downloaded file to start the installation wizard. Follow the steps in the wizard. Once the wizard completes, the Corretto 8 Preview will be installed in /Library/Java/JavaVirtualMachines/.
  2. To get the complete installation path, run the following command in a terminal:
/usr/libexec/java_home — verbose

4. Set the JAVA_HOME variable.

export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home

And enjoy coding!

How to Install for Docker

Build a Docker image with Amazon Corretto 8:

docker build -t amazon-corretto-jdk-8 github.com/corretto/corretto-8-docker

Your Docker image is ready and the name is amazon-corretto-jdk-8. Run it using the following command:

docker run -it amazon-corretto-jdk-8

If you want to develop a Java application and use Amazon Corretto as a parent image, then follow the script below.

Let us create a Hello World Java app with Amazon Corretto. First, create a Dockerfile with the following content.

FROM amazon-corretto-8 RUN
echo $’ \
public class Hello { \
public static void main(String[] args) { \
System.out.println(“Welcome to Amazon Corretto 8!”);
\ }
\ }’ > Hello.java
RUN javac Hello.java
CMD [“java”, “Hello”]

2. Build the image

docker build -t hello-app .

3. Run the image

docker run hello-app

That's all for now! Let us know what you think about Amazon Corretto in the comments section.

aws ,cloud ,docker ,java ,jdk ,openjdk ,opensource ,software

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}