乐趣区

关于ubuntu:Ubuntu安装Java环境

环境

  • 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

退出移动版