如何在 OS X 10.9.1 Mavericks 上为 Java 1.6 SE 安装 JDK

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

How do I install JDK for Java 1.6 SE on OS X 10.9.1 Mavericks

javamacos

提问by Anders Johansen

I currently have Java 7 on my machine, but would like to downgrade as some unit tests in my current project fails with newer versions of Java.

我目前在我的机器上安装了 Java 7,但我想降级,因为我当前项目中的某些单元测试因使用较新版本的 Java 而失败。

Note that I am running OS X 10.9.1, and the Java installation practices have changed since previous versions of the OS.

请注意,我运行的是 OS X 10.9.1,Java 安装实践自该操作系统的先前版本以来已发生变化。

Since Apple has changed the distribution around the time of 1.6, it's not obvious to me how I get the old version. Oracle does not supply Mac packages of 1.6 :(

由于 Apple 在 1.6 前后更改了发行版,因此我不清楚如何获得旧版本。Oracle 不提供 1.6 的 Mac 软件包:(

Clues?

线索?

采纳答案by Sami Laine

The OS/X Mavericks ships with Java 1.6, but in case you've installed another version, you can get back with 1.6 if you download a bundle of Java SE 1.6.0_65 from Apple.

OS/X Mavericks 附带 Java 1.6,但如果您安装了另一个版本,如果您从 Apple下载Java SE 1.6.0_65 捆绑包,则可以返回 1.6 。

If you've installed a later version of Java, e.g. 1.7, for all users, installing the bundle mentioned above will most likely break your existing newer installation.

如果您为所有用户安装了更高版本的 Java,例如 1.7,安装上述包很可能会破坏您现有的新安装。

回答by Matthew Kuraja

The response here from Sami Laine didn't help me but this StackOverflow page did: Java 6 Unsupported major.minor version 51.0

Sami Laine 的回复对我没有帮助,但是这个 StackOverflow 页面做了: Java 6 Unsupported major.minor version 51.0

To step down from Java 1.8 to 1.6 to support a legacy codebase, I also had to step down Maven from 3.3 to 3.2.

为了从 Java 1.8 降级到 1.6 以支持遗留代码库,我还必须将 Maven 从 3.3 降级到 3.2。