简体   繁体   English

如何在Mac OS X Snow Leopard上重新安装Java 6

[英]How to REINSTALL Java 6 on Mac OS X Snow Leopard

OK, I am idiot and messed with my Java install trying to get Resin to work. 好吧,我是白痴,并试图让我的Java安装让Resin工作。

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 SO 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? 如果是这样的话,是否有任何大师都知道,或者更好的是,在不重新安装操作系统的情况下,将Java 6重新安装回工厂设置的步骤是什么?

This answer comes 3 years late and is most likely useless for the original poster. 这个答案迟了3年,很可能对原版海报没用。 I will, however, leave it here for future reference. 但是,我会留在这里供将来参考。

When this happens, you don't have to reinstall the whole OS thanks to a very neat tool called Pacifist. 发生这种情况时,由于一个名为Pacifist的非常简洁的工具,您不必重新安装整个操作系统。 Pacifist allows you to reinstall pkg files regardless of any OS restrictions. Pacifist允许您重新安装pkg文件,无论任何操作系统限制。 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. 这意味着如果您下载最新的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/ 你可以在这里找到Pacifist: 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. 请注意:这是一个商业应用程序(20美元的共享软件),我与它或它的开发人员没有任何关系。 You can also "try it out" for free. 您也可以免费“试用”。

Following stapes did it for me: 以下镫骨为我做了:

  1. Download Apple's Java6 package from here 这里下载Apple的Java6包
  2. 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 将文件夹/System/Library/Java/JavaVirtualMachines/1.6.0.jdk移至/System/Library/Java/JavaVirtualMachines/1.6.0.jdk.old以进行备份
  3. Mount the dmg and run the installation 挂载dmg并运行安装
  4. A new folder /System/Library/Java/JavaVirtualMachines/1.6.0.jdk should appear 应该出现一个新文件夹/System/Library/Java/JavaVirtualMachines/1.6.0.jdk
  5. Remove /System/Library/Java/JavaVirtualMachines/1.6.0.jdk.old 删除/System/Library/Java/JavaVirtualMachines/1.6.0.jdk.old

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上面的步骤操作,就像魅力一样

绝望的时代呼吁采取绝望的措施

Snow Leopard's installer is smart enough to reinstall OS stuff and leave your prefs/files alone. Snow Leopard的安装程序非常智能,可以重新安装操作系统内容,并保留您的首选项/文件。 Just pop in the SL DVD and it'll detect that SL is already installed and ask if you want to re-install. 只需弹出SL DVD,它就会检测到SL已经安装并询问您是否要重新安装。 It should also install in such a way that 10.6.1 will still be intact after the install. 它也应该以这样的方式安装,即安装后10.6.1仍然完好无损。 I'm not 100% sure but I'd assume it will reinstall the Java frameworks as well. 我不是100%肯定,但我认为它也将重新安装Java框架。

Make sure you have a backup first. 确保先备份。

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. 我成功地使用Pacifist(www.charlessoft.com)和可从App Store免费获得的High Sierra安装程序应用程序在macOS High Sierra上重新安装System/Library/Frameworks/JavaVM.framework

When you download the installer app, do NOT continue the install! 下载安装程序应用程序时, 请勿继续安装! Quit the program after it starts, then run Pacifist against the app. 程序启动后退出程序,然后针对应用程序运行Pacifist。 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 . 我之所以这样做是因为许多应用程序(例如IntelliJ IDEA 2018)都希望文件位于/System/Library/Frameworks/JavaVM.framework It's much easier to restore that directory than do a bunch of symbolic links, etc. 恢复该目录要比一堆符号链接等更容易。

Thank you, Tiago Espinha for about 99% of this. 谢谢你,Tiago Espinha大约99%。 All I am doing is pointing out how to get a free High Sierra image. 我所做的就是指出如何获得免费的High Sierra图像。

http://code.google.com/p/googleappengine/issues/detail?id=4712让我将Java Update 4回滚到更新3.请参阅#39。

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

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