Today, oracle release JDK 19. How to install JDK 19 on Ubuntu 22.04 LTS?


1 Answer 1



wget https://download.oracle.com/java/19/latest/jdk-19_linux-x64_bin.deb

sudo apt-get -qqy install ./jdk-19_linux-x64_bin.deb

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-19/bin/java 1919

check result

root@vypc:~# java -version
java version "19" 2022-09-20
Java(TM) SE Runtime Environment (build 19+36-2238)
Java HotSpot(TM) 64-Bit Server VM (build 19+36-2238, mixed mode, sharing)

See https://ubuntuhandbook.org/index.php/2022/03/install-jdk-18-ubuntu/

  • 1
    You also need to run update-alternatives for every other program you want to run, such as javac, javadoc, and more. Here are two answers that give more complete lists.
    – mernst
    Oct 2, 2022 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.