简体   繁体   English

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

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

I have a clean install of El Capitan.我有一个全新安装的 El Capitan。 I have PHPStorm installed on my Macbook Air.我的 Macbook Air 上安装了 PHPStorm。 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.当我尝试运行该应用程序时,我收到一条错误消息,指出无法打开 PHP 风暴,因为它需要旧版 Java SE 6。我在下面附上了该错误的图像。

在此处输入图片说明

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

在此处输入图片说明

Any thoughts and help will be greatly appreciated!任何想法和帮助将不胜感激! Thanks谢谢

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

I've used Homebrew to install JDK 1.6.0_65:我使用Homebrew安装了 JDK 1.6.0_65:

brew tap homebrew/cask-versions
brew cask install java6

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).如果您在 OsX Yosemite 或 El Capitain 上遇到 Java 版本问题,您应该下载捆绑的 Webstorm(或来自 Jetbrains 的任何其他 IDE)。 It's working, I've tried it by myself.它有效,我自己试过了。

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


在此处输入图片说明


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,当你早上上班时无法编码——这就是问题——而且你不在乎它是否相关;)

i changed version to 1.8 here in below instructions and PhpStorm is now working for me.我在下面的说明中将版本更改为 1.8,PhpStorm 现在正在为我工​​作。 At the moment all our products require Apple JDK 1.6 to be installed in order to run on Mac.目前,我们所有的产品都需要安装 Apple JDK 1.6 才能在 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 尚未得到官方支持,并且存在阻止我们默认使用它的已知问题。 Oracle JDK 1.7.0_40 has added support for Retina and works much better than previous versions on Mac. Oracle JDK 1.7.0_40 添加了对 Retina 的支持,并且在 Mac 上比以前的版本运行得更好。 You are welcome to give it a try in case you have any problems with Apple JDK.如果您对 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*

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

This will install Java 6, 7 and 8. Enjoy!这将安装 Java 6、7 和 8。享受吧!

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

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