The javac executable is not part of the openjdk-*-jdk packages. To install it, you need to install the openjdk-17-jdk-headless package:

sudo apt install openjdk-17-jdk-headless

To manage the active version, don't forget about the update-alternatives command:

sudo update-alternatives --config java
sudo update-alternatives --config javac
Answer from DynamicBits on askubuntu.com
🌐
RoseHosting
rosehosting.com › home › how to install java 17 lts on ubuntu 20.04
How to Install Java 17 LTS on Ubuntu 20.04 | RoseHosting
October 5, 2022 - This is the easiest way to install the JDK using the apt package manager: ... openjdk 17.0.2 2022-01-18 OpenJDK Runtime Environment (build 17.0.2+8-Ubuntu-120.04) OpenJDK 64-Bit Server VM (build 17.0.2+8-Ubuntu-120.04, mixed mode, sharing · By default, Oracle Java is not available in the Ubuntu 20.04 default repository.
Discussions

Need help with installing java17
This is the guide for you: https://www.linuxuprising.com/2021/09/how-to-install-oracle-java-17-lts-on.html If it doesn't work, you should provide more info, specifically what exactly you type in console, and what error you're getting. More on reddit.com
🌐 r/Ubuntu
5
2
December 4, 2021
ubuntu - Where is 'javac' in java-17-openjdk-amd64? - Stack Overflow
Java: java --version openjdk 17.0.1 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12-Ubuntu-120.04) OpenJDK 64-Bit Server VM (build 17.0.1+12-Ubuntu-120.04, mixed mode, Sharing) I've successfully installed openjdk 17.0.1, but there is no 'javac' command in bin (such as exists in ... More on stackoverflow.com
🌐 stackoverflow.com
How to install Java?
Why THE HECK IS THERE NOT A BASIC INSTALLER FOR JAVA the package manager can install java... now WHICH java you specifically need... No idea. but the basics will be the same. https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-20-04 java -version If Java is not currently installed, you’ll see the following output: Output Command 'java' not found, but can be installed with: sudo apt install default-jre # version 2:1.11-72, or sudo apt install openjdk-11-jre-headless # version 11.0.7+10-3ubuntu1 sudo apt install openjdk-13-jre-headless # version 13.0.3+3-1ubuntu2 sudo apt install openjdk-14-jre-headless # version 14.0.1+7-1ubuntu1 sudo apt install openjdk-8-jre-headless # version 8u252-b09-1ubuntu1 Execute the following command to install the default Java Runtime Environment (JRE), which will install the JRE from OpenJDK 11: sudo apt install default-jre The JRE will allow you to run almost all Java software. note: i think you only install ONE of the above packages.. :) unless you know you need more than one version of java.. (i have not messed with java in years) No idea what specific java needs your game may require.. Note - on Ubuntu 20.10 I get the following.. java --version Command 'java' not found, but can be installed with: sudo apt install default-jre # version 2:1.11-72, or sudo apt install openjdk-11-jre-headless # version 11.0.9.1+1-0ubuntu1~20.10 sudo apt install openjdk-8-jre-headless # version 8u275-b01-0ubuntu1~20.10 (You will have to enable component called 'universe') sudo apt install openjdk-13-jre-headless # version 13.0.4+8-1 (You will have to enable component called 'universe') sudo apt install openjdk-14-jre-headless # version 14.0.2+12-1 (You will have to enable component called 'universe') sudo apt install openjdk-15-jre-headless # version 15+36-1 (You will have to enable component called 'universe') the 'universe' they mention is the universe repository in the package manager settings. Otherwise - i think it will install openjdk-11 which is in the default repositories. PS: guides that mention the webup8 repositories - are likely outdated. the webup8 site has stopped hosting the non-free java stuff in their repos due to Licensing changes Installing Oracle JDK 11 Oracle’s licensing agreement for Java doesn’t allow automatic installation through package managers. To install the Oracle JDK, which is the official version distributed by Oracle, you must create an Oracle account and manually download the JDK to add a new package repository for the version you’d like to use. Then you can use apt to install it with help from a third party installation script. More on reddit.com
🌐 r/Ubuntu
8
0
January 1, 2021
how to install java 17 on debian 9?
Thanks for being a part of | r/Admincraft | ! | We'd love it if you also joined us on Discord! Join thousands of other Minecraft administrators for real-time discussion of all things related to running a quality server. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/admincraft
13
4
April 2, 2022
🌐
OVHcloud
us.ovhcloud.com › home › how to install java on ubuntu 22.04 ?
How to install Java on Ubuntu 22.04 ?
To install Java on Ubuntu, the easiest way is to use apt-get command: sudo apt-get update && apt-get -y install openjdk-17-jdk
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-java-with-apt-on-ubuntu-22-04
How to Install Java with Apt on Ubuntu (JRE & JDK) | DigitalOcean
February 2, 2026 - To install the OpenJDK version ... version 2:1.11-72build1, or sudo apt install openjdk-11-jre-headless # version 11.0.14+9-0ubuntu2 sudo apt install openjdk-17-jre-headless # version 17.0.2+8-1 sudo apt install openjdk-18-jre-headless # version 18~36ea-1 sudo apt install ...
🌐
Reddit
reddit.com › r/ubuntu › need help with installing java17
r/Ubuntu on Reddit: Need help with installing java17
December 4, 2021 -

For the last two days I've been cracking my head on attempting to install java17 on my ubuntu20.10 machine.

I need java17 to run the latest version of a minecraft server. The problem I'm encountering is the following:

I can add the ppa:linuxuprising/java repository succesfully. (this is the most common method of installing this version of java). The sudo apt update command succeeds as well.

However when I try to install java17 through this repository it keeps stating that the package can't be found, which is strange because in the web viewer of the same repository the packages are there.

I'm not very well versed in the linuxverse so any help would be welcome.

🌐
Se-education
se-education.org › guides › tutorials › javaInstallationLinux.html
Java 17 Installation Guide for Linux Users
This guide explains how to install the (specifically, OpenJDK Java 17) on Linux using the command line. This guide was created using Ubuntu 22.04 but the steps for other Debian based Linux distros should be similar.
Find elsewhere
🌐
Ubuntu
ubuntu.com › tutorials › install-jre
Install the Java Runtime Environment | Ubuntu
In this guide, we’ll be going through the installation of both JRE packages. Of course, you generally only need to pick the one that best suits your needs and preferences. ... That’s all you need. If you have that, let’s proceed to the next step! With new versions of Java released every 6 months, there are multiple versions available for use.
🌐
Ubuntu
ubuntu.com › developers › docs › reference › availability › java
Available Java versions - Ubuntu for Developers
April 5, 2026 - This page lists Java versions available in Ubuntu releases, including CRaC and GraalVM. Ubuntu OpenJDK (deb) packages:,,, Ubuntu version, available Java versions, java-common version,,, 25.10 (Ques...
🌐
Cherry Servers
cherryservers.com › home › blog › linux › how to install java on ubuntu 22.04 | step-by-step tutorial chatbots
How to Install Java on Ubuntu 22.04 | Step-by-Step Tutorial chatbots | Cherry Servers
November 7, 2025 - OpenJDK provides all the tools you need to develop Java-based applications and microservices, including the Java compiler, Java Runtime Environment (JRE), and Java class library. Ubuntu repositories provide the OpenJDK package by default, and you can search for its availability as shown. ... At the time of writing, the most recent release is OpenJDK 20. The latest LTS ( Long Term Support ) release is OpenJDK 17 and will be supported until 30 September 2026. To install OpenJDK 11 using the APT package manager, execute the command:
🌐
ComfyUI
mslinn.com › blog › 2023 › 09 › 28 › jdk.html
Installing JDK 17 on Ubuntu
September 28, 2023 - $ apt show -a openjdk-17-jdk Package: openjdk-17-jdk Version: 17.0.8.1+1~us1-0ubuntu1~23.04 Priority: optional Section: java Source: openjdk-17 Origin: Ubuntu Maintainer: Ubuntu Developers ... Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1544 kB Provides: java-compiler, java-sdk (= 17), java10-sdk, java11-sdk, java12-sdk, java13-sdk, java14-sdk, java15-sdk, java16-sdk, java17-sdk, java2-sdk, java5-sdk, java6-sdk, java7-sdk, java8-sdk, java9-sdk Depends: openjdk-17-jre (= 17.0.8.1+1~us1-0ubuntu1~23.04), openjdk-17-jdk-headless (= 17.0.8.1+1~us1-0ubuntu1~23.04), libc6 (>= 2.3
🌐
Faun
faun.pub › how-to-install-and-manage-multiple-jdk-versions-on-ubuntu-22-04-3de225c7d8c8
How to Install and Manage Multiple JDK Versions on Ubuntu 22.04 | by Achini Udari Jayasena | FAUN.dev() 🐾
November 1, 2024 - /usr/lib/jvm/java-11-openjdk-amd64 /usr/lib/jvm/java-17-openjdk-amd64 /usr/lib/jvm/java-21-openjdk-amd64 · Note the path to the version you want to set as `JAVA_HOME`. ... Save and close the file. Then apply the changes with: ... This should display the path you set. Installing and managing multiple JDK versions on Ubuntu is simple using the `update-alternatives` tool.
🌐
Azul Systems
azul.com › home › azul downloads
Java 8, 11, 17, 21, 25 Download for Linux, Windows and macOS
January 30, 2023 - Click here to download the Azul Zulu Builds of OpenJDK for Java 8, 11, 17, 21, 25 for Linux, Windows and macOS. Also download Azul Platform Prime.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install java on ubuntu
How to Install Java on Ubuntu
February 20, 2025 - This step-by-step guide will show you how to install Java on Ubuntu.
🌐
Contabo
contabo.com › home › how to install java on ubuntu 18.04, 20.04 & 22.04 using apt-get
How To Install Java on Ubuntu 18.04, 20.04 & 22.04 using Apt-Get
August 11, 2023 - In this comprehensive step-by-step guide you will learn how to install different versions of Java on your Ubuntu server using Apt-Get.
🌐
Linuxize
linuxize.com › home › java › how to install java on ubuntu 24.04
How to Install Java on Ubuntu 24.04 | Linuxize
May 3, 2026 - Java 21 is the default Java version ... install another available version, replace the version number. For example, use openjdk-17-jdk for Java 17....
🌐
LinuxCapable
linuxcapable.com › home › ubuntu › how to install openjdk 17 on ubuntu 26.04, 24.04 and 22.04
How to Install OpenJDK 17 on Ubuntu 26.04, 24.04 and 22.04 - LinuxCapable
April 29, 2026 - Install OpenJDK 17 on Ubuntu 26.04, 24.04 and 22.04 using APT. Covers JRE vs JDK, version management, JAVA_HOME setup, removal.
🌐
Oracle
oracle.com › java › technologies › downloads
Download the Latest Java LTS Free
Download the Java including the latest version 17 LTS on the Java SE Platform. These downloads can be used for any purpose, at no cost, under the Java SE binary code license.
🌐
Medium
medium.com › @ovi64567 › enhancing-development-environment-installing-java-17-on-ubuntu-a932a09d7bc9
“Enhancing Development Environment: Installing Java 17 on Ubuntu” | by Ovi | Medium
February 17, 2024 - Access the official Java 17 distribution package suitable for Ubuntu. Navigate through Oracle’s website or OpenJDK repositories to download the package securely. ... Follow step-by-step instructions to install Java 17 on your Ubuntu system.
🌐
BlueVPS
bluevps.com › blog › step-by-step guide: how to install java on ubuntu 22.04
Step-by-Step Guide: How to Install Java on Ubuntu 22.04 - Blog - BlueVPS
September 25, 2023 - But in this guide, we will install ... on Ubuntu 22.04. Choose the suitable version of OpenJDK and install it using the apt repository. ... Now, press ‘y’ and ‘Enter’ to proceed with the installation.