我使用的是 Debian 10.6。
$ sudo apt install openjdk-16-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-16-jre-headless
这是我的包裹清单。请注意,只有 openjdk 11,没有其他内容。
$ apt search openjdk
Sorting... Done
Full Text Search... Done
default-jdk/oldstable 2:1.11-71 i386
Standard Java or Java compatible Development Kit
default-jdk-doc/oldstable 2:1.11-71 amd64
Standard Java or Java compatible Development Kit (documentation)
default-jdk-headless/oldstable,now 2:1.11-71 amd64 [installed,automatic]
Standard Java or Java compatible Development Kit (headless)
default-jre/oldstable,now 2:1.11-71 amd64 [installed,automatic]
Standard Java or Java compatible Runtime
default-jre-headless/oldstable,now 2:1.11-71 amd64 [installed,automatic]
Standard Java or Java compatible Runtime (headless)
java-package/oldstable,oldstable 0.62 all
Utility for creating Java Debian packages
jtreg/oldstable,oldstable 4.2-b14-1 all
Regression Test Harness for the OpenJDK platform
libhsdis0-fcml/oldstable 1.1.3-3 amd64
HotSpot disassembler plugin using FCML
libreoffice/oldstable 1:6.1.5-3+deb10u7 amd64 [upgradable from: 1:6.1.5-3+deb10u6]
office productivity suite (metapackage)
nvidia-openjdk-8-jre/oldstable 9.+8u77~9.2.148-7+deb10u1 amd64
NVIDIA provided OpenJDK Java runtime, using Hotspot JIT
openjdk-11-dbg/oldstable 11.0.13+8-1~deb10u1 amd64
答案1
apt
找不到openjdk-16-jre-headless
因为OpenJDK 16 软件包在任何 Debian 版本中都不可用。
Debian 10 中唯一可用的版本是OpenJDK 11。 Debian 11 有OpenJDK 17。这两个版本都是有长期支持的版本。
答案2
openjdk-16-jre-headless
没有在 Debian 上打包。你必须使用openjdk-11-jre-headless
,启用安全存储库后即可安装。