1.官網下載jdkhtml
https://www.oracle.com/technetwork/java/javase/downloads/index.htmljava
勾選 Accept License Agreement,點擊jdk-8u221-macosx-x64.dmg下載macos
2.安裝oracle
雙擊下載的jdkspa
彈出窗口,再雙擊jdk3d
彈出窗口,點擊繼續htm
安裝完畢,點擊關閉blog
3.驗證get
command + 空格,輸入ter, 回車io
輸入 java -version
顯示jdk版本信息即安裝成功
輸入
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
輸入密碼
sudo rm -fr /Library/PreferencesPanes/JavaControlPanel.prefpane
查找當前版本
輸入:ls /Library/Java/JavaVirtualMachines/
輸出:jdk1.8.0_221.jdk
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk