环境

  • Linux/Ubuntu20.04LTS
  • openjdk-11-jre-headless

流程

1.打开终端查看本地是否安装了Java

lauiji@lauiji-IdeaPad-15sIML-2020:~$ java -version

Command 'java' not found, but can be installed with:

sudo apt install openjdk-11-jre-headless  # version 11.0.11+9-0ubuntu2~20.04, or
sudo apt install default-jre              # version 2:1.11-72
sudo apt install openjdk-8-jre-headless   # version 8u292-b10-0ubuntu1~20.04
sudo apt install openjdk-13-jre-headless  # version 13.0.4+8-1~20.04
sudo apt install openjdk-14-jre-headless  # version 14.0.2+12-1~20.04

2.提示没有安装,这是就可以按提示安装你想要安装的版本了

lauiji@lauiji-IdeaPad-15sIML-2020:~$sudo apt install openjdk-11-jre-headless

3.安装好后,再次查看安装版本

lauiji@lauiji-IdeaPad-15sIML-2020:~$ java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

这个时候就安装成功了!

[遇见雨季,吃定彩虹] -- Layuji


梁雨季
4 声望0 粉丝

平淡,才是生活的常态,那些兴奋或痛苦只是调味剂。只有足够沉稳的人,才会不被怪诞或新奇的事物诱惑,任世界繁华,终有自己的选择。