如何在 El Capitan (OS X 10.11) 上设置需要旧版 Java 的应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30786538/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 10:10:07  来源:igfitidea点击:

How to set up applications requiring legacy java on El Capitan (OS X 10.11)?

javamacosphpstormosx-elcapitan

提问by flopperJ

I have a clean install of El Capitan. I have PHPStorm installed on my Macbook Air. When I try to run the application, I get an error that says PHP storm can't be opened because it requires legacy Java SE 6. I've attached an image of the error below.

我有一个全新安装的 El Capitan。我的 Macbook Air 上安装了 PHPStorm。当我尝试运行该应用程序时,我收到一条错误消息,指出无法打开 PHP Storm,因为它需要旧版 Java SE 6。我在下面附上了错误的图像。

enter image description here

在此处输入图片说明

I had the same problem when I installed Yosemite but I was able to install the legacy java fix (Java for OS X 2014-001) from Apple's website. When I try installing that same java fix I get the following Error: Java for OS X can't be installed on this disk. A newer version of this package is already installed

我在安装 Yosemite 时遇到了同样的问题,但我能够从 Apple 的网站安装旧的 Java 修复程序(Java for OS X 2014-001)。当我尝试安装相同的 Java 修复程序时,出现以下错误: Java for OS X can't be installed on this disk. A newer version of this package is already installed

enter image description here

在此处输入图片说明

Any thoughts and help will be greatly appreciated! Thanks

任何想法和帮助将不胜感激!谢谢

回答by Samuel Ondrek

If you have a problem with Java version on OsX Yosemite or El Capitain, you should download bundled Webstorm (or any other IDE from Jetbrains). It's working, I've tried it by myself.

如果您在 OsX Yosemite 或 El Capitain 上遇到 Java 版本问题,您应该下载捆绑的 Webstorm(或来自 Jetbrains 的任何其他 IDE)。它有效,我自己试过了。

https://www.jetbrains.com/webstorm/download/

https://www.jetbrains.com/webstorm/download/



enter image description here

在此处输入图片说明



And yes, this is not a programming related question, but it's an IDE for programming and when you come to work at morning and you can't code — that's problem — and you don't care if it's related ;)

是的,这不是一个与编程相关的问题,但它是一个用于编程的 IDE,当你早上上班时无法编码——这就是问题——而且你不在乎它是否相关;)

回答by Mike Hermann

i changed version to 1.8 here in below instructions and PhpStorm is now working for me. At the moment all our products require Apple JDK 1.6 to be installed in order to run on Mac. JDK 1.7 from Oracle is not officially supported yet and has known problems that stop us from using it by default. Oracle JDK 1.7.0_40 has added support for Retina and works much better than previous versions on Mac. You are welcome to give it a try in case you have any problems with Apple JDK.

我在下面的说明中将版本更改为 1.8,PhpStorm 现在正在为我工​​作。目前,我们所有的产品都需要安装 Apple JDK 1.6 才能在 Mac 上运行。来自 Oracle 的 JDK 1.7 尚未得到官方支持,并且存在阻止我们默认使用它的已知问题。Oracle JDK 1.7.0_40 添加了对 Retina 的支持,并且在 Mac 上比以前的版本运行得更好。如果您对 Apple JDK 有任何问题,欢迎您尝试一下。

To force running under JDK 1.7 edit /Applications/.app/Contents/Info.plist file, change JVMVersion from 1.6* to 1.7* :

要强制在 JDK 1.7 下运行,请编辑 /Applications/.app/Contents/Info.plist 文件,将 JVMVersion 从 1.6* 更改为 1.7* :

JVMVersion 1.7*

JVM 版本 1.7*

回答by jase

Download Java 6 for El Capitan:

为 El Capitan 下载 Java 6:

Java for OS X 2015-001 Beta

适用于 OS X 的 Java 2015-001 测试版

https://support.apple.com/kb/DL1824

https://support.apple.com/kb/DL1824

回答by nwinkler

I've used Homebrewto install JDK 1.6.0_65:

我使用Homebrew安装了 JDK 1.6.0_65:

brew tap homebrew/cask-versions
brew cask install java6

回答by neu242

  1. Open Terminal.app and write sudo nvram boot-args="rootless=0"+ return
  2. Reboot
  3. Install Java from https://support.apple.com/kb/dl1572?locale=en_US
  1. 打开 Terminal.app 并写入sudo nvram boot-args="rootless=0"+ 返回
  2. 重启
  3. https://support.apple.com/kb/dl1572?locale=en_US安装 Java

This will install Java 6, 7 and 8. Enjoy!

这将安装 Java 6、7 和 8。享受吧!