To upgrade Amazon Corretto 17 on Amazon Linux 2, you typically would use the yum package manager. However, if the new version is not yet available in the Amazon Linux repositories, you'll need to wait for it to be added. To check for updates and upgrade when they become available, you can use the following steps: 1. First, check for updates by running: sudo yum check-update java-17-amazon-corretto 2. If an update is available, you can upgrade by running: sudo yum update java-17-amazon-corretto If you want to avoid manual installation and stick with the repository-based approach, the best course of action is to periodically check for updates using these commands. Amazon typically updates their repositories with new Corretto versions, but there might be a delay between the release announcement and its availability in the repositories. It's worth noting that you installed the headful variant of Corretto 17. If you want to ensure you have the full JDK, including development tools, you might want to consider using the following package instead: sudo yum install java-17-amazon-corretto-devel This package includes the complete JDK, which might be more suitable for development purposes. Remember, the timing of updates in the Amazon Linux repositories can vary, so patience may be required if you prefer to avoid manual installation and wait for the repository update. **Sources** Amazon Corretto 17 Installation Instructions for Amazon Linux 2 and Amazon Linux 2023 - Amazon Corretto 17 Amazon Corretto 17 Installation Instructions for Debian-Based, RPM-Based and Alpine Linux Distributions - Amazon Corretto 17 Answer from re:Post Agent on repost.aws
🌐
AWS
docs.aws.amazon.com › corretto › corretto 17 user guide › amazon corretto 17 guide for linux › amazon corretto 17 installation instructions for amazon linux 2 and amazon linux 2023
Amazon Corretto 17 Installation Instructions for Amazon Linux 2 and Amazon Linux 2023 - Amazon Corretto 17
While it is recommended to use ... /etc/alternatives/java_sdk_17_openjdk for JDK. The paths under /etc/alternatives/ may point to another JDK depending on the packages installed and system configuration. 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. Install using yum ...
Top answer
1 of 1
2
To upgrade Amazon Corretto 17 on Amazon Linux 2, you typically would use the yum package manager. However, if the new version is not yet available in the Amazon Linux repositories, you'll need to wait for it to be added. To check for updates and upgrade when they become available, you can use the following steps: 1. First, check for updates by running: sudo yum check-update java-17-amazon-corretto 2. If an update is available, you can upgrade by running: sudo yum update java-17-amazon-corretto If you want to avoid manual installation and stick with the repository-based approach, the best course of action is to periodically check for updates using these commands. Amazon typically updates their repositories with new Corretto versions, but there might be a delay between the release announcement and its availability in the repositories. It's worth noting that you installed the headful variant of Corretto 17. If you want to ensure you have the full JDK, including development tools, you might want to consider using the following package instead: sudo yum install java-17-amazon-corretto-devel This package includes the complete JDK, which might be more suitable for development purposes. Remember, the timing of updates in the Amazon Linux repositories can vary, so patience may be required if you prefer to avoid manual installation and wait for the repository update. **Sources** Amazon Corretto 17 Installation Instructions for Amazon Linux 2 and Amazon Linux 2023 - Amazon Corretto 17 Amazon Corretto 17 Installation Instructions for Debian-Based, RPM-Based and Alpine Linux Distributions - Amazon Corretto 17
Discussions

yum - how to install amazon Corretto 17 on centos - Stack Overflow
I need to install jdk 17 on centos7. When I try the yum install, I get the below message sudo yum install -y java-17-amazon-corretto-devel Loaded plugins: fastestmirror Loading mirror speeds from ... More on stackoverflow.com
🌐 stackoverflow.com
java - How do I install JDK 17 on my AWS AMI Ec2 instance? - Stack Overflow
I need to install JDK 17 on my AWS EC2 AMI instance. Is there any command? Any answers would be appreciated! More on stackoverflow.com
🌐 stackoverflow.com
Make Package 'java-17-amazon-corretto-headless' available in https://yum.corretto.aws/
The package is very interesting ... Linuxes. It is smaller than a JDK and does not contain irrelevant parts for running a Java application. For example, one does not need a java compiler to run a Java application. Please provide the package 'java-17-amazon-corretto-headless' in https://yum.corretto.aws/ , so I can install it ... More on github.com
🌐 github.com
0
April 5, 2023
amazon ec2 - How do I install Java in an ec2 instance? - Stack Overflow
java -version sudo yum install java-1.8.0-openjdk I am using this command but I get the error Last metadata expiration check: 0:52:13 ago on Fri Nov 3 16:57:25 2023. No match for argument: java-1... More on stackoverflow.com
🌐 stackoverflow.com
🌐
AWS
docs.aws.amazon.com › corretto › corretto 17 user guide › amazon corretto 17 guide for linux › amazon corretto 17 installation instructions for debian-based, rpm-based and alpine linux distributions
Amazon Corretto 17 Installation Instructions for Debian-Based, RPM-Based and Alpine Linux Distributions - Amazon Corretto 17
After the repository is added, you can install Corretto 17 by running this command: ... Download the Linux .rpm file from the Downloads page. Install the downloaded .rpm file using yum localinstall. For example install x86_64 rpm using the following command: sudo yum localinstall java-17-ama...
🌐
SysAdminXpert
sysadminxpert.com › home › aws cloud › how to install java 17 on amazon linux
How To Install Java 17 On Amazon Linux | SysAdminXpert
June 8, 2024 - When you install Java 17 using yum install java-17-amazon-corretto or yum install java-17-amazon-corretto-devel, the yum package manager automatically handles updating alternatives.
🌐
TecAdmin
tecadmin.net › install-java-on-amazon-linux
How to Install Java (JDK/JRE) on Amazon Linux – TecAdmin
April 26, 2025 - Before proceeding, ensure you meet ... or command line. You have sudo privileges or access to the root user. Activate the yum repository on Amazon Linux 2....
Top answer
1 of 1
2

Install with package managers:

deb-based distros (such as Debian or Ubuntu)

# Download deb package from https://www.oracle.com/java/technologies/downloads/
# And then
sudo dpkg -i jdk-17_linux-x64_bin.deb

rpm-based distros (such as RHEL or CentOS)

# Download rpm package from https://www.oracle.com/java/technologies/downloads/
# And then
sudo rpm -i jdk-17_linux-x64_bin.rpm 

Any distro without or with differrent package manager

Download x64 Compressed tar.gz Archive from https://www.oracle.com/java/technologies/downloads/

Create jvm directory

sudo mkdir -p /usr/lib/jvm

Change to the directory.

cd /usr/lib/jvm

Extract jdk-17_linux-x64_bin.tar.gz to that directory.

~/Downloads/ - is a directory where archive is saved. If your downloaded file is in any other location, change the command according to your path.

sudo tar -xvzf ~/Downloads/jdk-17_linux-x64_bin.tar.gz

Enter the following command to open the environment variables file.

sudo ${EDITOR} /etc/environment

Edit your ${PATH}

# Add this to the $PATH variable
/usr/lib/jvm/jdk-17/bin

Add the following environment variables at the end of the file.

JAVA_HOME="/usr/lib/jvm/jdk-17"

Inform the system about the Java's location.

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-17/bin/java" 0
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-17/bin/javac" 0
sudo update-alternatives --set java /usr/lib/jvm/jdk-17/bin/java
sudo update-alternatives --set javac /usr/lib/jvm/jdk-17/bin/javac

To check version:

java -version
Find elsewhere
🌐
SearchBlox
developer.searchblox.com › v10.7 › docs › installing-on-amazon-linux
Installing on Amazon Linux 2 - Architecture
Install OpenJDK 17 by running the following command: sudo yum install java-17-amazon-corretto Install wget by running the following command: yum install wget Verify the installation by running the following command: java -version Set ...
🌐
SearchBlox
developer.searchblox.com › docs › installing-on-amazon-linux
Installing on Amazon Linux 2 - Architecture - SearchBlox
Amazon users can go with Amazon Linux 2023 vs Amazon Linux 2. Recommended EC2 instance type is g6.xlarge . Install OpenJDK 25 by running the following command: sudo yum install java-25-amazon-corretto-devel java -version
🌐
Northcoder
northcoder.com › post › installing-corretto-on-amazon-linux
Installing Corretto on Amazon Linux 2 | northCoder
December 29, 2021 - ... If you are using a different ... list. For most systems, you must run the following commands: ... After that, you should be able to run the yum install command....
🌐
AWS
docs.aws.amazon.com › corretto › corretto 8 user guide › amazon corretto 8 guide for linux › amazon corretto 8 installation instructions for amazon linux 2 and amazon linux 2023
Amazon Corretto 8 Installation Instructions for Amazon Linux 2 and Amazon Linux 2023 - Amazon Corretto 8
Enable the yum repository in Amazon Linux 2. This is not required on Amazon Linux 2022 and later. ... 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. ... Install Amazon Corretto 8 as JDK. ... While it is recommended to use /usr/lib/jvm/java...
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › getting started with programming runtimes on al2023 › java in al2023
Java in AL2023 - Amazon Linux 2023
May 22, 2026 - AL2023 provides several versions of Amazon Corretto to support Java based workloads. All Java based packages included in AL2023 are built with Amazon Corretto 17 .
🌐
LinuxShout
linux.how2shout.com › home › how to install java 17 on amazon linux 2023
How to install Java 17 on Amazon linux 2023 - LinuxShout
August 8, 2023 - Here in this quick guide, we take you through the process step by step to get Java 17 which offers enhanced performance, new language features, and improvements that can benefit your applications. ... Go to your AWS Cloud to directly access the Amazon Linux 2023 server’s terminal or use the local ssh to remotely connect it. Of course, you must have sudo access to install packages on it.
🌐
GitHub
github.com › corretto › corretto-17 › issues › 114
Make Package 'java-17-amazon-corretto-headless' available in https://yum.corretto.aws/ · Issue #114 · corretto/corretto-17
April 5, 2023 - The package is very interesting to use in a container and thus should be also available in containers for "RPM-based" Linuxes. It is smaller than a JDK and does not contain irrelevant parts for running a Java application. For example, one does not need a java compiler to run a Java application. Please provide the package 'java-17-amazon-corretto-headless' in https://yum.corretto.aws/ , so I can install it using
Author   corretto
Top answer
1 of 2
1

I am guessing you are using amazon linux ami

sudo yum install java 


then press tab twice it will show you list of available options like below

Then complete the installation with chosen version example

sudo yum install java-11-amazon-corretto-headless.x86_64
2 of 2
-1

The error message Unable to find a match: java-1.8.0-openjdk means that the yum package manager cannot find the java-1.8.0-openjdk package in the repositories. This can happen if the package is not available in the repositories, or if the repositories are not configured correctly.

To fix this error, you can try the following:

  1. Make sure that the repositories are configured correctly. You can do this by running the following command:
sudo yum repolist

This will list all of the repositories that are configured on your EC2 instance. Make sure that the repository that contains the java-1.8.0-openjdk package is listed.

  1. If the repository is listed, try updating the repositories:
sudo yum update

This will update the package manager's knowledge of the repositories.

  1. If the package is still not found, you can try installing it manually. You can download the java-1.8.0-openjdk RPM package from the Oracle website. Once you have downloaded the RPM package, you can install it using the following command:
sudo yum localinstall java-1.8.0-openjdk-*.rpm

Once the java-1.8.0-openjdk package is installed, you should be able to run the java -version command without any errors.

Here are some additional tips for installing Java on EC2:

  • You can also use the Amazon Corretto distribution of OpenJDK, which is available in the Amazon Linux repositories. To install Corretto, run the following command:
sudo yum install java-11-amazon-corretto-11.0.5+10-1.amzn2.x86_64
🌐
AWS
docs.aws.amazon.com › corretto › corretto 25 user guide › amazon corretto 25 guide for linux › amazon corretto 25 installation instructions for amazon linux 2023
Amazon Corretto 25 Installation Instructions for Amazon Linux 2023 - Amazon Corretto 25
While it is recommended to use ... /etc/alternatives/java_sdk_25_openjdk for JDK. The paths under /etc/alternatives/ may point to another JDK depending on the packages installed and system configuration. 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. Install using yum ...
🌐
AWS
docs.aws.amazon.com › corretto › corretto 11 user guide › amazon corretto 11 guide for linux › amazon corretto 11 installation instructions for amazon linux 2 and amazon linux 2023
Amazon Corretto 11 Installation Instructions for Amazon Linux 2 and Amazon Linux 2023 - Amazon Corretto 11
While it is recommended to use ... /etc/alternatives/java_sdk_11_openjdk for JDK. The paths under /etc/alternatives/ may point to another JDK depending on the packages installed and system configuration. 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. Install using yum ...
🌐
AWS re:Post
repost.aws › questions › QUu2-HGjkETk-Dm1Y7px03mw › when-will-java-17-amazon-corretto-be-patched-in-the-amazon-linux-2-ami
When will java-17-amazon-corretto be patched in the Amazon Linux 2 AMI? | AWS re:Post
April 22, 2022 - When can we expect to see the patched version? [ec2-user@ip-XXX ~]$ sudo yum install -y java-17-amazon-corretto-headless Loaded plugins: extras_suggestions, langpacks, priorities, update-motd ...