Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Amazon Corretto 8 Installation Instructions for Amazon Linux 2 and Amazon Linux 2023 - Amazon Corretto 8

Amazon Corretto 8 Installation Instructions for Amazon Linux 2 and Amazon Linux 2023

This topic describes how to install and uninstall Amazon Corretto 8 on a host or container running the Amazon Linux 2 or Amazon Linux 2023 operating systems.

Option 1: Install using the yum Package Manager on Amazon Linux

  1. Enable the yum repository in Amazon Linux 2. This is not required on Amazon Linux 2022 and later.

    sudo amazon-linux-extras enable corretto8
  2. You can install Amazon Corretto 8 as either the runtime environment (JRE) or the full development environment (JDK). The development environment includes the runtime environment.

    Install Amazon Corretto 8 as JRE.

    sudo yum install java-1.8.0-amazon-corretto

    Install Amazon Corretto 8 as JDK.

    sudo yum install java-1.8.0-amazon-corretto-devel

The installation location is /usr/lib/jvm/java-1.8.0-amazon-corretto.<cpu_arch>.

Option 2: Download and Install RPMs Manually

  1. Download RPMs from the Downloads page for your CPU architecture. To install the JDK, you will need to download the RPMs for both the JDK and the JRE.

  2. Install using yum localinstall.

    sudo yum localinstall java-1.8.0-amazon-corretto*.rpm

Verify Your Installation

In the terminal, run the following command to verify the installation.

java -version

Expected output for 8u442:

openjdk version "1.8.0_442" OpenJDK Runtime Environment Corretto-8.442.06.1 (build 1.8.0_442-b06) OpenJDK 64-Bit Server VM Corretto-8.442.06.1 (build 25.442-b06, mixed mode)

If you see a version string that doesn't mention Corretto, run the following command to change the default java or javac providers.

sudo alternatives --config java

If using the JDK you should also run:

sudo alternatives --config javac

Uninstall Amazon Corretto 8

You can uninstall Amazon Corretto 8 with the following commands.

Uninstall JRE:

sudo yum remove java-1.8.0-amazon-corretto

Uninstall JDK:

sudo yum remove java-1.8.0-amazon-corretto-devel
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.