1、删除运行路径和运行环境等
sudo rm -fr /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencesPanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application Support/Java
2、查看当前版本的jdk
ls /Library/Java/JavaVirtualMachines/
3、删除JDK
例子:
sudo rm -rf /Library/Java/JavaVirtualMachines/temurin-8.jdk
4、最后 java -version