Java 17.x on Amazon Linux
This article provides step-by-step instructions for installing Java 17.x on an Amazon Linux 2023 system. Java is a critical component for running enterprise applications, middleware, and development tools. This guide ensures a clean, secure, and verified installation, suitable for production or development environments.
Prerequisites
Ensure the following conditions are met before starting the installation:
A running Amazon Linux 2023 virtual machine (EC2 or on-prem).
A user account with sudo privileges.
An active internet connection is required to download packages from the repository.
Installation Steps
Update the System Package Index
Update the package manager to ensure that all existing packages and repository metadata are up to date.
sudo yum update -ySample Reference Screenshot:

Install Java 17 (Amazon Corretto)
Use the following command to install Amazon Corretto 17, a free, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK).
sudo yum install -y java-17-amazon-correttoSample Reference Screenshot:

Verify the Installation
After the installation completes, verify that Java 17 is installed and accessible from the command line:
java --versionSample Reference Screenshot:

Expected Output Example:
openjdk 17.0.x 202x-xx-xx LTS OpenJDK Runtime Environment Corretto-17.x.x.x (build 17.0.x+xx) OpenJDK 64-Bit Server VM Corretto-17.x.x.x (build 17.0.x+xx, mixed mode)
Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.
Last updated
Was this helpful?

