如何在 Mac OS X Snow Leopard 上重新安装 Java 6
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1684732/
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
How to REINSTALL Java 6 on Mac OS X Snow Leopard
提问by Genericrich
OK, I am idiot and messed with my Java install trying to get Resin to work.
好吧,我是个白痴,并且在尝试让 Resin 工作时搞砸了我的 Java 安装。
Now, things are broken. I figured I could just reinstall the developer tools that came with my new Mac (brand new 13" MacBook Pro) and that would take care of it.
现在,事情被打破了。我想我可以重新安装我的新 Mac(全新的 13 英寸 MacBook Pro)随附的开发人员工具,这样就可以解决问题。
Alas, I was wrong. Snow Leopard comes with Java 6 JRE and JDK but as far as I can tell YOU CANNOT EVER REINSTALL just Java, you have to reinstall the OS.
唉,我错了。Snow Leopard 带有 Java 6 JRE 和 JDK,但据我所知,您永远无法仅重新安装 Java,您必须重新安装操作系统。
Do any Gurus on S.O. know if this is the case or, better yet, what the steps are to reinstall Java 6 back to the factory settings without reinstalling the OS?
SO 上的任何专家都知道是否是这种情况,或者更好的是,在不重新安装操作系统的情况下将 Java 6 重新安装回出厂设置的步骤是什么?
回答by lemotdit
Do you have the Leopard util disk?
你有 Leopard util 磁盘吗?
http://www.macosxhints.com/article.php?story=2009051215025819
http://www.macosxhints.com/article.php?story=2009051215025819
回答by alphazero
Desperate times call for desperate measures.
绝望的时代需要采取绝望的措施。
回答by Chris Williams
Snow Leopard's installer is smart enough to reinstall OS stuff and leave your prefs/files alone. Just pop in the SL DVD and it'll detect that SL is already installed and ask if you want to re-install. It should also install in such a way that 10.6.1 will still be intact after the install. I'm not 100% sure but I'd assume it will reinstall the Java frameworks as well.
Snow Leopard 的安装程序足够聪明,可以重新安装操作系统的东西,而不必理会您的首选项/文件。只需弹出 SL DVD,它就会检测到 SL 已安装并询问您是否要重新安装。它还应该以这样的方式安装,即 10.6.1 在安装后仍然完好无损。我不是 100% 确定,但我认为它也会重新安装 Java 框架。
Make sure you have a backup first.
首先确保你有一个备份。
回答by purplemonkeydishwasher
http://code.google.com/p/googleappengine/issues/detail?id=4712worked for me to roll back Java Update 4 to Update 3. See commend #39.
http://code.google.com/p/googleappengine/issues/detail?id=4712帮助我将 Java Update 4 回滚到 Update 3。请参阅推荐 #39。
回答by Tiago Espinha
This answer comes 3 years late and is most likely useless for the original poster. I will, however, leave it here for future reference.
这个答案晚了 3 年,很可能对原始海报没有用。但是,我将其留在这里以供将来参考。
When this happens, you don't have to reinstall the whole OS thanks to a very neat tool called Pacifist. Pacifist allows you to reinstall pkg files regardless of any OS restrictions. This means that if you download the latest Java for OSX .dmg file and use Pacifist to install it, all the Java files will be overwritten and everything will be back to a working state.
发生这种情况时,您不必重新安装整个操作系统,这要归功于名为 Pacifist 的非常简洁的工具。无论任何操作系统限制,Pacifist 都允许您重新安装 pkg 文件。这意味着如果您下载最新的 Java for OSX .dmg 文件并使用 Pacifist 安装它,则所有 Java 文件都将被覆盖,一切都将恢复到工作状态。
I had a similar problem and this did it for me.
我有一个类似的问题,这对我有用。
You can find Pacifist here: http://www.charlessoft.com/
你可以在这里找到和平主义者:http: //www.charlessoft.com/
Please note: it's a commercial application (shareware for $20) and I am in no way affiliated with it or its developers. You can also "try it out" for free.
请注意:这是一个商业应用程序(20 美元的共享软件),我与它或其开发人员没有任何关系。您也可以免费“试用”。
回答by Martin Sturm
Following stapes did it for me:
以下镫骨为我做了:
- Download Apple's Java6 package from here
- Moved the folder /System/Library/Java/JavaVirtualMachines/1.6.0.jdk to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk.old for having a Backup
- Mount the dmg and run the installation
- A new folder /System/Library/Java/JavaVirtualMachines/1.6.0.jdk should appear
- Remove /System/Library/Java/JavaVirtualMachines/1.6.0.jdk.old
- 从这里下载 Apple 的 Java6 包
- 将文件夹 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk 移动到 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk.old 以进行备份
- 挂载 dmg 并运行安装
- 应该会出现一个新文件夹 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk
- 删除 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk.old
回答by Turner Technician
the full answer, is a mixture of the posts other people have put up.
完整的答案是其他人发布的帖子的混合。
you have to copy the following folders to a safe location for back up, and once you have the back up copied elsewhere, just delete the folders from thier original directories - thus the computer thinking you dont have it installed when you run the installer.
您必须将以下文件夹复制到安全位置进行备份,一旦您将备份复制到其他地方,只需从原始目录中删除文件夹 - 因此计算机在您运行安装程序时认为您没有安装它。
So, copy these to a safe location, and then delete the originals from: 1: System/Library/Java 2: System/Library/Frameworks/JavaVM.Framework 3: Library/Java
因此,将这些复制到安全位置,然后从以下位置删除原件: 1: System/Library/Java 2: System/Library/Frameworks/JavaVM.Framework 3: Library/Java
(number 3 is just on the root of your Mac Hard Drive) Just followed the above steps on Snow Leopard 10.6.8 and worked like a charm
(数字 3 就在您的 Mac 硬盘驱动器的根目录上)只需在 Snow Leopard 10.6.8 上按照上述步骤操作即可
回答by jmalin
Following up on an earlier recommendation:
跟进之前的建议:
I had success re-installing System/Library/Frameworks/JavaVM.framework
on macOS High Sierra using a combination of Pacifist (www.charlessoft.com) and the High Sierra installer app that's freely available from the App Store.
我System/Library/Frameworks/JavaVM.framework
使用 Pacifist (www.charlessoft.com) 和可从 App Store 免费获得的 High Sierra 安装程序应用程序的组合成功地在 macOS High Sierra 上重新安装。
When you download the installer app, do NOTcontinue the install! Quit the program after it starts, then run Pacifist against the app. The "Core" part of the package contains the System/Library/Frameworks/JavaVM.framework
directory you want.
当您下载安装程序应用程序时,请不要继续安装!启动后退出程序,然后对应用程序运行和平主义者。包的“核心”部分包含System/Library/Frameworks/JavaVM.framework
您想要的目录。
I did this because many apps such as IntelliJ IDEA 2018 expect files to be in /System/Library/Frameworks/JavaVM.framework
. It's much easier to restore that directory than do a bunch of symbolic links, etc.
我这样做是因为许多应用程序(例如 IntelliJ IDEA 2018)都希望文件位于/System/Library/Frameworks/JavaVM.framework
. 恢复该目录比恢复一堆符号链接等要容易得多。
Thank you, Tiago Espinha for about 99% of this. All I am doing is pointing out how to get a free High Sierra image.
谢谢你,蒂亚戈·埃斯皮尼亚 (Tiago Espinha) 完成了大约 99% 的工作。我所做的只是指出如何获得免费的 High Sierra 图像。