简体   繁体   English

无法从 MacBook Air M1 移除 Java 17

[英]Unable to remove Java 17 from MacBook Air M1

I tried to remove Java using sudo rm -rf "/Library/Java/JavaVirtualMachines" as mentioned on Oracle docs, still Java 17 is being shown to me, after uninstalling it from my system. I tried to remove Java using sudo rm -rf "/Library/Java/JavaVirtualMachines" as mentioned on Oracle docs, still Java 17 is being shown to me, after uninstalling it from my system. Any pointer to remove Java from MacBook?从 MacBook 删除 Java 的任何指针?

arvindsangwan@Arvinds-MacBook-Air ~ % java -version
    openjdk version "17.0.1" 2021-10-19
    OpenJDK Runtime Environment (build 17.0.1+12-39)
    OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing)
    arvindsangwan@Arvinds-MacBook-Air ~ % cd /Library/Java                               
    arvindsangwan@Arvinds-MacBook-Air Java % ls
    arvindsangwan@Arvinds-MacBook-Air Java %

Steps I performed were from here: https://www.java.com/en/download/help/mac_uninstall_java.html我执行的步骤来自这里: https://www.java.com/en/download/help/mac_uninstall_java.html

  1. In the Terminal window Copy, Paste and run the commands below (one by one):在终端 window 中复制、粘贴并运行以下命令(一一):

     sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane sudo rm -fr ~/Library/Application\ Support/Oracle/Java
  2. Then after successfully uninstalling Java, you may remove Java Deployment cache: In the Terminal window Copy and Paste the commands below:然后在成功卸载 Java 后,您可以删除 Java 部署缓存: 在终端 window 复制并粘贴以下命令:

     rm -r ~/"Library/Application Support/Oracle/Java"
  3. then remove the jdk folder and it's content:然后删除 jdk 文件夹及其内容:

     sudo rm -r -f /Library/Java/JavaVirtualMachines/jdk<"your_version">.jdk
  4. then perform the holy computer restart .然后执行神圣的电脑重启

If you have more than 1 java version installed you may also find useful the info from this page: https://java.tutorials24x7.com/blog/how-to-switch-java-version-on-mac如果您安装了超过 1 个 java 版本,您可能还会从此页面找到有用的信息: https://java.tutorials24x7.com/blog/how-to-switch-java-version-on-mac

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM