Debian 11にJava11をインストールする
環境
# cat /etc/debian_version
11.2
操作方法
1.デフォルトのOpenJDKインストール可能バージョンを確認します
# sudo apt info default-jdk Package: default-jdk Version: 2:1.11-72 Priority: optional Section: java Source: java-common (0.72) Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org> Installed-Size: 6,144 B Provides: java-sdk, java10-sdk, java11-sdk, java2-sdk, java5-sdk, java6-sdk, java7-sdk, java8-sdk, java9-sdk Depends: default-jre (= 2:1.11-72), default-jdk-headless (= 2:1.11-72), openjdk-11-jdk Homepage: https://wiki.debian.org/Java/ Tag: devel::buildtools, devel::compiler, devel::lang:java, devel::library, devel::runtime, implemented-in::TODO, implemented-in::java, role::devel-lib, role::metapackage, role::program Cnf-Extra-Commands: javac,javadoc,jar Download-Size: 1,056 B APT-Sources: http://deb.debian.org/debian bullseye/main amd64 Packages Description: Standard Java or Java compatible Development Kit This dependency package points to the Java runtime, or Java compatible development kit recommended for this architecture, which is openjdk-11-jdk for amd64.
2.default-jdkをインストールします
システムのパッケージの更新を行う
# sudo apt-get update # sudo apt install -y default-jdk
3.インストールが完了したら、javaコマンドでバージョンを確認します。
# java --version openjdk 11.0.14 2022-01-18 OpenJDK Runtime Environment (build 11.0.14+9-post-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1deb11u1, mixed mode, sharing)