在Debian 12上安装OpenJDK 17(使用操作系统的默认版本)

首先

Debian12中默認安裝了OpenJDK
原文:OpenJDK的各種安裝方法和EOL匯總

支持 (“Support”)

不明的是,OpenJDK 17项目的领导厂商或社区将取决于他们表示的支持截止日期以及Debian操作系统的终端支持时间。

日志

安装

# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

# apt update;apt install -y openjdk-17-jdk
... 略

确认种种

# which java
/usr/bin/java

# java -version
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.7+7-Debian-1deb12u1, mixed mode, sharing)