安装JDK
在命令行中输入
javac
得到反馈:
Command 'javac' not found, but can be installed with: sudo apt install openjdk-11-jdk-headless # version 11.0.8+10-0ubuntu1~20.04, or sudo apt install default-jdk # version 2:1.11-72 sudo apt install openjdk-13-jdk-headless # version 13.0.3+3-1ubuntu2 sudo apt install openjdk-14-jdk-headless # version 14.0.1+7-1ubuntu1 sudo apt install openjdk-8-jdk-headless # version 8u265-b01-0ubuntu2~20.04 sudo apt install ecj # version 3.16.0-1
我选择的是
sudo apt install openjdk-11-jdk-headless
配置VSCode
用VSCode打开一个java文件,弹窗拓展都下载。Done。