1、环境: MacOS
2、操作步骤
(1)打开终端,输入命令
$ /usr/libexec/java_home -V ,显示本地的 jdk 地址如下
Matching Java Virtual Machines (1):
11.0.16.1, x86_64: "Java SE 11.0.16.1" /Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/Home
(2)执行命令删除目录,将彻底删除本地安装的 jdk
$ cd /Library/Java/JavaVirtualMachines/
$ sudo rm -rf jdk-11.0.16.1.jdk/