1

我看到 Java 6u65-apple 是可用的 Java 版本之一。这个 JDK 在 macOS 上安装在哪里?这个 JDK 会与更新的(最新的)Oracle Java JRE 和 JDK 共存吗?

4

1 回答 1

0

我尝试了您在 macOS High Sierra 上使用 sdkman 的意图。它应该将它安装在 ~/.sdkman 下面,但它似乎不起作用。这是我和其他人得到的,例如参见https://gitter.im/sdkman/user-issues?at=5a1db5de71ad3f87363f4754

$ sdk install java 6u65-apple
tr: Illegal byte sequence

Apple requires that you agree with the Apple Software License Agreement
prior to installation.

The license agreement can be found in PDF format here:

  http://images.apple.com/legal/sla/docs/JavaForOSX.pdf

Do you agree to the terms of this agreement? (Y/n): Y

Downloading: java 6u65-apple

In progress...

######################################################################## 100.0%
Binary validation passed...
We will be needing super powers...

Repackaging Java 6u65...
Attaching to the DMG...
Mounting DMG as Volume...
Volume(s) mounted successfully
Installing PKG inside DMG...
installer: Cannot install on volume / because it is disabled.
installer: Es ist bereits eine neuere Version dieses Pakets installiert.
Copy JDK Home to temp folder...
cp: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home: No such file or directory
unlink: /Users/gg/.sdkman/tmp/out/java-6u65-apple/bundle: No such file or directory
ln: /Users/gg/.sdkman/tmp/out/java-6u65-apple/bundle: No such file or directory
Preparing archive...

zip error: Nothing to do! (try: zip -qr --symlinks /Users/gg/.sdkman/tmp/.zip . -i .)
Unmounting volume...
"/Volumes/Java for OS X 2015-001" unmounted successfully.
Done repackaging...
mv: rename /Users/gg/.sdkman/tmp/.zip to /Users/gg/.sdkman/archives/java-6u65-apple.zip: No such file or directory
unzip:  cannot find or open /Users/gg/.sdkman/archives/java-6u65-apple.zip, /Users/gg/.sdkman/archives/java-6u65-apple.zip.zip or /Users/gg/.sdkman/archives/java-6u65-apple.zip.ZIP.
rm: /Users/gg/.sdkman/archives/java-6u65-apple.zip: No such file or directory

Stop! The archive was corrupt and has been removed! Please try installing again.

所以我在http://osxdaily.com/2017/06/29/how-install-java-macos-high-sierra/上找到了指向https://support.apple.com/kb/dl1572?locale=en_US的链接并单击“下载”,它确实按预期在 /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/ 中安装了 JDK6。你可以随意切换:

$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
$ export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)

由于 javac 1.6 运行良好,这是研究 sdkman 的唯一原因,我完全删除了它。

于 2018-01-12T21:00:34.863 回答