# 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

1. **Update the System Package Index**
   * Update the package manager to ensure that all existing packages and repository metadata are up to date.

     ```bash
     sudo yum update -y
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FtGzcUcVfI1fI4uYoZqaz%2F2.jpg?alt=media&#x26;token=1d99eeb3-c934-4b8e-af9b-df954aaa4689" alt=""><figcaption></figcaption></figure>

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This step is essential to prevent conflicts or missing dependencies during Java installation.</p></div>

2. **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).

     ```bash
     sudo yum install -y java-17-amazon-corretto
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FvH7LIbUPjpApDpee5VU2%2F3.jpg?alt=media&#x26;token=c77669a6-0617-4e4f-b4c5-1d37ceb5cc29" alt=""><figcaption></figcaption></figure>

3. **Verify the Installation**
   * After the installation completes, verify that Java 17 is installed and accessible from the command line:

     ```bash
     java --version
     ```

     \
     *Sample Reference Screenshot:*

     <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FuBW5mogSuljdj5jKFczL%2F4.jpg?alt=media&#x26;token=e7b69aeb-1423-4296-9e39-d1f5e47dca1b" alt=""><figcaption></figcaption></figure>
   * **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)
     ```

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>If the version output is displayed successfully, the Java installation is complete.</p></div>

***

Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.
