
Verify your Java installation by checking its version: java -version Output openjdk version "17.0.2" Then, use the command below to install Java 17: sudo apt install openjdk-17-jre-headless -y OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing) Install Java 17 From Apt RepositoryĪnother way that you can use to install Java 17, is to use the Apt repository on Ubuntu 22.04.įirst, you need to update your local package index with the command below: sudo apt update OpenJDK Runtime Environment (build 17.0.2+8-86) Verify your Java Home path: echo $JAVA_HOME OutputĪlso, you can verify your Java installation by checking its version: java -version Output Source your profile file with the following command: source /etc/profile.d/jdk17.sh Next, move your extracted file to the /opt directory: sudo mv jdk-17.0.2 /opt/ Configure Java Environment Path on Ubuntu 22.04Īt this point, you need to configure the Java home path by using the following command: sudo tee /etc/profile.d/jdk17.sh < Without the linking exception, components that linked to the Java class library would be subject to the terms of the GPL license. The project is licensed under the GNU General Public License (GNU GPL) version 2 with a linking exception. OpenJDK, which stands for Open Java Development Kit, originated from an effort initiated by Sun Microsystems in 2006 and is now sponsored and led by Oracle. OpenJDK is a free, open-source version of the Java Development Kit for the Java Platform, Standard Edition (Java SE). This tutorial intends to show you to Install OpenJDK 17 (Java 17) on Ubuntu 22.04.