install openjdk 21

I have Ubuntu 22.04.3 LTS.

I have run

sudo apt update

but when I execute

apt install openjdk-21

the package can’t be located

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openjdk-21

even this package seems to be added in Sept:
https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa

where is the right place to see the last openjdk version added to the ubuntu repository?

when I tab on:

$ sudo apt-get install openjdk-

I get up to java 19:

openjdk-11-dbg           openjdk-11-jre-headless  openjdk-17-jdk-headless  openjdk-18-doc           openjdk-19-dbg           openjdk-19-jre-zero      openjdk-8-jre
openjdk-11-demo          openjdk-11-jre-zero      openjdk-17-jre           openjdk-18-jdk           openjdk-19-demo          openjdk-19-source        openjdk-8-jre-headless
openjdk-11-doc           openjdk-11-source        openjdk-17-jre-headless  openjdk-18-jdk-headless  openjdk-19-doc           openjdk-8-dbg            openjdk-8-jre-zero
openjdk-11-jdk           openjdk-17-dbg           openjdk-17-jre-zero      openjdk-18-jre           openjdk-19-jdk           openjdk-8-demo           openjdk-8-source
openjdk-11-jdk-headless  openjdk-17-demo          openjdk-17-source        openjdk-18-jre-headless  openjdk-19-jdk-headless  openjdk-8-doc            
openjdk-11-jre           openjdk-17-doc           openjdk-18-dbg           openjdk-18-jre-zero      openjdk-19-jre           openjdk-8-jdk            
openjdk-11-jre-dcevm     openjdk-17-jdk           openjdk-18-demo          openjdk-18-source        openjdk-19-jre-headless  openjdk-8-jdk-headless
Asked By: zeugor

||

As of 13-11-2023, the openjdk-21 package for Ubuntu 22.04 is in the -proposed pocket of the Ubuntu repositories.

In other words, it’s still in testing.

If you wish to help test the package, see how to add the Proposed repo. Testers should be experienced with how to troubleshoot problems and file useful bug reports.

If you don’t wish to help test, then simply be patient. The package will migrate to the 22.04 Universe repository when testing is complete.

For newer releases of Ubuntu (like 23.10), the package is already in Universe.

If you add a PPA or other non-Ubuntu version of OpenJDK, remember that it’s likely to be incompatible with the (supported Ubuntu repository) Ubuntu package. So keep track of what you install; you might need to remove all of it.

Answered By: user535733
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.