无法在 Mac OS X (Mountain Lion 10.8.4) 上卸载 Java 7 JDK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18007804/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't Uninstall Java 7 JDK on Mac OS X (Mountain Lion 10.8.4)
提问by user2644292
I tried searching for hours trying to figure out how to uninstall Java 7 JDK on my Mac since it kept crashing both Eclipse and some Minecraft mod packs. I tried to restore back to Java 6 JDK instead which is provided by Apple. I tried looking at Oracle's site to try to find out how to fix the problem. If you scroll down to the bottom of the page you'll see where it tells you do uninstall using sudo. I can't find the Java folder inside of Library, I try using the Go To Folder function too in Finder but it seems I cannot find it. I've also tried through Terminal and still cannot find the folder. It seems that no one else has had this problem before.. I've asked on forum sites and cannot find an answer. Please respond as quick as possible!
我尝试搜索了几个小时试图弄清楚如何在我的 Mac 上卸载 Java 7 JDK,因为它不断使 Eclipse 和一些 Minecraft mod 包崩溃。我尝试恢复到 Apple 提供的 Java 6 JDK。我尝试查看 Oracle 的站点以尝试找出解决问题的方法。如果您向下滚动到页面底部,您会看到它告诉您使用 sudo 卸载的位置。我在库中找不到 Java 文件夹,我也尝试在 Finder 中使用转到文件夹功能,但似乎找不到它。我也尝试过终端,但仍然找不到该文件夹。似乎以前没有其他人遇到过这个问题.. 我在论坛网站上问过,找不到答案。请尽快回复!
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html
回答by Louis Hong
If you can't find the Java Home, open up terminal and enter:
如果找不到 Java Home,请打开终端并输入:
env
look for or SOMETHING LIKE THIS Mine might not be the same as yours
寻找或类似的东西 我的可能和你的不一样
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.7/Home
This is where your Java is installed
这是安装 Java 的位置
If you want to see it in Finder then open up Finder and press Command + Shift + G and enter in the path to java home.
如果您想在 Finder 中看到它,请打开 Finder 并按 Command + Shift + G 并输入 java home 的路径。
to uninstall simply remove the java version from :
卸载只需从以下位置删除 java 版本:
/System/Library/Java/JavaVirtualMachines
with
和
cd /System/Library/Java/JavaVirtualMachines
rm -r some.version.java.jdk
Note: Sometimes Java is install in /System/Library but sometimes it's installed on /Library, so that's why you couldn't find Java in /Library which the Oracle document suggested.
注意:有时 Java 安装在 /System/Library 中,但有时它安装在 /Library 中,这就是为什么在 Oracle 文档建议的 /Library 中找不到 Java 的原因。
回答by Anastasios Andronidis
You can look inside:
你可以看看里面:
/Library/Java/JavaVirtualMachines
If there is a folder of jdk.1.7or similar, you can delete it. Restart your programs and they will get Java 1.6as a default.
如果有jdk.1.7或类似的文件夹,可以删除。重新启动您的程序,它们将获得默认的Java 1.6。
回答by tangrammer
in my current case: sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk
在我目前的情况下: sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk

