debian linux安装jdk21(.deb版本)

1.下载并上传到服务器:https://www.oracle.com/java/technologies/downloads/#java21

2.执行命令安装

 dpkg -i jdk-22_linux-x64_bin.deb 
image.png

从以上截图看出,无需设置环境变量,已经自动好了

官方文档:
Installing the 64-Bit JDK Package on Debian-based Linux Platforms
You can install the JDK Debian package for 64-bit Linux from the (.deb) file.

To install the 64-bit JDK Debian package on a Linux platform:
Download the required file:
jdk-22.interim.update.patch_linux-x64_bin.deb. For example jdk-22_linux-x64_bin.deb
Before you download a file, you must accept the license agreement. Anyone (not only root users) can install the archive file in any location having write access.

Install the package using the following command:
$ sudo dpkg -i jdk-22_linux-x64_bin.deb

The Java Development Kit files are installed into /usr/lib/jvm/jdk-<FEATURE>-oracle-<ARCH> directory. For example, JDK 22 releases for x64 will be installed in /usr/lib/jvm/jdk-22-oracle-x64 directory.

Delete the .deb file if you want to save disk space.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容