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
Answer from Yasen on Stack Overflow
🌐
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
Option 1: Install the headless Amazon Corretto 17: ... While it is recommended to use /usr/lib/jvm/java-17-amazon-corretto.<cpu_arch> location, installation may also add alternative links making installation location accessible via /etc/alternatives/jre, /etc/alternatives/jre_17 and ...
🌐
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...
Discussions

[Bug] - java-17-amazon-corretto-headless and java-21-amazon-corretto-headless provide the same file(s)
Describe the bug ATM it is not possible to install java-17-amazon-corretto-devel and java-21-amazon-corretto-devel at the same time (next to each other), as dnf install fails. To Reproduce docker r... More on github.com
🌐 github.com
4
November 8, 2023
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
Installation instructions for Corretto 25 failing on EC2
Which repos do you have enabled? More on reddit.com
🌐 r/aws
14
1
October 16, 2025
How to install Java?
I think the first command will install the LTS version, which is currently 11. This has always been confusing on Debian distros. Are you just running java? Or are you looking to build new java code? Install the jdk if you want to build, not the jre. More on reddit.com
🌐 r/pop_os
4
5
February 25, 2020
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
🌐
AWS
docs.aws.amazon.com › corretto › corretto 17 user guide › downloads for amazon corretto 17
Downloads for Amazon Corretto 17 - Amazon Corretto 17
This topic lists all the downloads ... Corretto 17. You can choose Permanent URLs pointing to the latest version, or use Version Specific URLs which point to a specific version. Permanent URLs always point to the most recent release of a package. For example, to retrieve the latest Linux Corretto 17 ...
🌐
SearchBlox
developer.searchblox.com › docs › installing-on-amazon-linux
Installing on Amazon Linux 2
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
Find elsewhere
🌐
AWS
docs.aws.amazon.com › corretto › corretto 17 user guide › amazon corretto 17 guide on windows › amazon corretto 17 installation instructions for windows 10 or later
Amazon Corretto 17 Installation Instructions for Windows 10 or Later - Amazon Corretto 17
You have the option of setting a custom installation path. By default, Amazon Corretto 17 is installed at C:\Program Files\Amazon Corretto\. If you set a custom path, make a note of it for the next step. Once the install wizard is finished, set the JAVA_HOME and PATH environment variables.
🌐
Tenable
tenable.com › plugins › nessus › 156182
Amazon Linux 2 : java-17-amazon-corretto, java-11-amazon-corre...<!-- --> | Tenable®
December 18, 2021 - The remote Amazon Linux 2 host is missing a security update. The version of java-1.7.0-openjdk installed on the remote host is prior to 1.7.0.261-2.6.22.2. The version of java-1.8.0-openjdk installed on the remote host is prior to 1.8.0.312.b07-1. The version of java-11-amazon-corretto installed on the remote host is prior to 11.0.13+8-2. The version of java-17...
🌐
CliffsNotes
cliffsnotes.com › home › computer science
01 Amazon Corretto 17 (Java) Install Guide (pdf) - CliffsNotes
September 4, 2025 - Note: The installer will configure the operating system environment variables JAVA_HOME and PATH. (Optionally you can expand the [+] next to the Setup Environment for more information, but this is not required. If you do take a look, do not change any settings.) Instructions on how to manually configure system environment variables can be found at the bottom of this handout. Click Next Click Install You may be asked if you want to give permission for Amazon Corretto to install, grant permission to do so.
🌐
GitHub
github.com › amazonlinux › amazon-linux-2023 › issues › 544
[Bug] - java-17-amazon-corretto-headless and java-21-amazon-corretto-headless provide the same file(s) · Issue #544 · amazonlinux/amazon-linux-2023
November 8, 2023 - docker run public.ecr.aws/amazonlinux/amazonlinux:2023 bash -c 'dnf install java-21-amazon-corretto-devel java-17-amazon-corretto-devel-1:17.0.8+8-1.amzn2023.1.x86_64 -y'
Author   amazonlinux
🌐
DBeaver
dbeaver.io › download
Download | DBeaver Community
2 weeks ago - DBeaver is tested and verified for Windows, Linux and Mac OS X. ... Windows installer – run installer executable. It will automatically upgrade version (if needed).
🌐
Jenkins
jenkins.io › doc › book › installing › linux
Linux
sudo apt update sudo apt install fontconfig openjdk-21-jre java -version · If the installation was successful, you should see an output similar to the following:
🌐
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
🌐
Amazon Web Services
aws.amazon.com › developer tools › amazon corretto › faqs
Amazon Corretto FAQs
2 weeks ago - Frequently asked questions about Amazon Corretto a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK). Corretto comes with no-cost long-term support. Amazon runs Corretto internally on thousands of production services and Corretto is certified as ...
🌐
Medium
medium.com › @brucetushabe › how-to-install-java-17-on-amazon-lightsail-lamp-debian-a74b33d34ce5
How to install Java 17 on Amazon Lightsail Lamp Debian | by Bruce Tushabe | Medium
February 16, 2023 - How to install Java 17 on Amazon Lightsail Lamp Debian Welcome to our guide on how to install Oracle Java 17 / OpenJDK 17 on 11/10/9 Linux system. Java is a popular programming language used for …
🌐
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 - Important Note: Amazon Linux 2023 no longer includes separate OpenJDK packages by default. The Amazon Corretto repository is the recommended source for Java. ... This should display “openjdk version 17” or similar, confirming successful ...
🌐
Sonar
sonarsource.com › products › sonarqube › downloads
Download SonarQube | Sonar
Detection of advanced bugs causing runtime errors in Python, Java, C#, and VB.NET
🌐
LinuxShout
linux.how2shout.com › home › how to install java 8/11 on amazon linux 2023
How to install Java 8/11 on Amazon Linux 2023 - LinuxShout
June 24, 2023 - Access your Amazon Linux 2023 command terminal using SSH and then execute the system update command. It will install the latest available updates, if any, plus rebuild the DFN package index cache.
🌐
Northcoder
northcoder.com › post › installing-corretto-on-amazon-linux
Installing Corretto on Amazon Linux 2 | northCoder
December 29, 2021 - Linux 2 is an operating system provided by Amazon. The full installation instructions for Java 17 are here.