10

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
zeugor
  • 523
  • 2
  • 6
  • 10
  • Why is it a problem if you can run a command? Please edit your question to make clear waht your problem is, please also mention your Ubuntu version. – mook765 Nov 13 '23 at 21:33
  • sorry, edited, I can't run – zeugor Nov 13 '23 at 21:34
  • 1
    What do you mean when you say you can't run this command? is your keyboard not working or what prevent you from running the command? Do you get any error message? If so, please provide the entire error message. – mook765 Nov 13 '23 at 21:50
  • 1
    So did you run sudo add-apt-repository ppa:openjdk-r/ppa before running sudo apt update? – mook765 Nov 13 '23 at 22:23
  • no, not sure if i should, maybe there are another official repository, cos this one is warned as unsupported and untrusted: "You can update your system with unsupported packages from this untrusted PPA by..." – zeugor Nov 13 '23 at 22:30

1 Answers1

10

UPDATE: Simply use sudo apt install openjdk-21-jdk . It's in the Universe repository, so be sure you have that enabled.

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.

user535733
  • 62,253