java - 无法在 Mac OS Yosemite 上安装 JDK 8u25

标签 java macos

尝试遵循 Unable to install JRE8/JRE7 on OS X Yosemite 上的建议我仍然遇到无法在我的计算机上安装 JDK 8u25 的问题。这是安装程序日志

10:44 $ sudo installer -dumplog -verbose -pkg /Volumes/JDK\ 8\ Update\ 25/JDK\ 8\ Update\ 25.pkg -target /
installer: Package name is JDK 8 Update 25
Dec 29 10:44:33 buddy.fritz.box installer[11031] : Product archive /Volumes/JDK 8 Update 25/JDK 8 Update 25.pkg trustLevel=202
installer: Installing at base path /
installer: Preparing for installation….....
Dec 29 10:44:34 buddy.fritz.box installer[11031] : -[IFDInstallController(Private) _buildInstallPlan]: location = file://localhost
Dec 29 10:44:34 buddy.fritz.box installer[11031] : -[IFDInstallController(Private) _buildInstallPlan]: file://localhost/Volumes/JDK%208%20Update%2025/JDK%208%20Update%2025.pkg#jdk18025.pkg
Dec 29 10:44:34 buddy.fritz.box installer[11031] : -[IFDInstallController(Private) _buildInstallPlan]: file://localhost/Volumes/JDK%208%20Update%2025/JDK%208%20Update%2025.pkg#javaappletplugin.pkg
Dec 29 10:44:34 buddy.fritz.box installer[11031] : Set authorization level to root for session
Dec 29 10:44:34 buddy.fritz.box installer[11031] : Will use PK session
Dec 29 10:44:34 buddy.fritz.box installer[11031] : Starting installation:
installer: Preparing the disk….....
Dec 29 10:44:34 buddy.fritz.box installer[11031] : Configuring volume "Macintosh HD"
Dec 29 10:44:34 buddy.fritz.box installer[11031] : Preparing disk for local booted install.
Dec 29 10:44:34 buddy.fritz.box installer[11031] : Free space on "Macintosh HD": 67.29 GB (67294580736 bytes).
Dec 29 10:44:34 buddy.fritz.box installer[11031] : Create temporary directory "/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//Install.11031P0FtDl"
installer: Preparing JDK 8 Update 25….....
Dec 29 10:44:34 buddy.fritz.box installer[11031] : IFPKInstallElement (2 packages)
Dec 29 10:44:34 buddy.fritz.box installer[11031] : Using authorization level of root for IFPKInstallElement
installer: Waiting for other installations to complete….....
Dec 29 10:44:34 buddy.fritz.box installer[11031] : PackageKit: Enqueuing install with framework-specified quality of service (utility)
installer: Configuring the installation….....
installer:
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Moving items into place….....
#
installer: Moving items into place….....
installer: Validating packages….....
installer: Cleaning up….....
Dec 29 10:44:39 buddy.fritz.box installer[11031] : install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “JDK 8 Update 25.pkg”." UserInfo=0x7f98f0902080 {NSFilePath=./postinstall, NSURL=file://localhost/Volumes/JDK%208%20Update%2025/JDK%208%20Update%2025.pkg#javaappletplugin.pkg, PKInstallPackageIdentifier=com.oracle.jre, NSLocalizedDescription=An error occurred while running scripts from the package “JDK 8 Update 25.pkg”.}
#Dec 29 10:44:39 buddy.fritz.box installer[11031] : Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.

installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)

非常感谢任何帮助

最佳答案

做了更多研究来解决这个问题,我想我调查了包内容( https://apple.stackexchange.com/questions/15658/how-can-i-open-a-pkg-file-manually 揭示了如何提取 pkg 文件)

11:27 $ pkgutil --expand /Volumes/JDK\ 8\ Update\ 25/JDK\ 8\ Update\ 25.pkg /tmp/java/jdk

查看包并再次查看日志表明问题出在 javaappletplugin.pkg 中,而不是 JDK 本身

然后我运行了包中的 preinstallpostinstall 脚本,显示了以下输出

/tmp/java/jdk/javaappletplugin.pkg/Scripts
12:08 $ sudo ./postinstall
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Resources/com.oracle.java.Java-Updater.plist: Operation already in progress
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Resources/com.oracle.java.Helper-Tool.plist: Operation already in progress
objc[12239]: Class JavaLaunchHelper is implemented in both /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java and /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/./libjli.dylib. One of the two will be used. Which one is undefined.
java.lang.IllegalArgumentException: Invalid argument CFG_FILE: /Library/Application Support/Oracle/Java/java.settings.cfg
    at com.oracle.install.InstallOptions.validateConfigFile(InstallOptions.java:165)
    at com.oracle.install.InstallOptions.parseArguments(InstallOptions.java:102)
    at com.oracle.install.InstallOptions.main(InstallOptions.java:46)
/tmp/java/jdk/javaappletplugin.pkg/Scripts

I could now see that the Script is unable to finish its Installation. After I have moved the existing plugin out of the way

sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin.old

重新运行 postinstall 脚本,错误消失了,我想让安装程序再试一次

/tmp/java/jdk/javaappletplugin.pkg/Scripts
12:10 $ sudo ./postinstall
rm: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Info.plist: No such file or directory

瞧,安装成功完成

12:10 $ sudo installer -dumplog -verbose -pkg /Volumes/JDK\ 8\ Update\ 25/JDK\ 8\ Update\ 25.pkg -target /
installer: Package name is JDK 8 Update 25
Dec 29 12:10:58 buddy.fritz.box installer[12459] : Product archive /Volumes/JDK 8 Update 25/JDK 8 Update 25.pkg trustLevel=202
installer: Installing at base path /
installer: Preparing for installation….....
Dec 29 12:10:59 buddy.fritz.box installer[12459] : -[IFDInstallController(Private) _buildInstallPlan]: location = file://localhost
Dec 29 12:10:59 buddy.fritz.box installer[12459] : -[IFDInstallController(Private) _buildInstallPlan]: file://localhost/Volumes/JDK%208%20Update%2025/JDK%208%20Update%2025.pkg#jdk18025.pkg
Dec 29 12:10:59 buddy.fritz.box installer[12459] : -[IFDInstallController(Private) _buildInstallPlan]: file://localhost/Volumes/JDK%208%20Update%2025/JDK%208%20Update%2025.pkg#javaappletplugin.pkg
Dec 29 12:10:59 buddy.fritz.box installer[12459] : Set authorization level to root for session
Dec 29 12:11:00 buddy.fritz.box installer[12459] : Will use PK session
Dec 29 12:11:00 buddy.fritz.box installer[12459] : Starting installation:
installer: Preparing the disk….....
Dec 29 12:11:00 buddy.fritz.box installer[12459] : Configuring volume "Macintosh HD"
Dec 29 12:11:00 buddy.fritz.box installer[12459] : Preparing disk for local booted install.
Dec 29 12:11:00 buddy.fritz.box installer[12459] : Free space on "Macintosh HD": 66.84 GB (66840113152 bytes).
Dec 29 12:11:00 buddy.fritz.box installer[12459] : Create temporary directory "/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//Install.12459GS2WWn"
installer: Preparing JDK 8 Update 25….....
Dec 29 12:11:00 buddy.fritz.box installer[12459] : IFPKInstallElement (2 packages)
Dec 29 12:11:00 buddy.fritz.box installer[12459] : Using authorization level of root for IFPKInstallElement
installer: Waiting for other installations to complete….....
Dec 29 12:11:00 buddy.fritz.box installer[12459] : PackageKit: Enqueuing install with framework-specified quality of service (utility)
installer: Configuring the installation….....
installer:
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Moving items into place….....
#
installer: Running package scripts….....
#
installer: Running package scripts….....
#
installer: Running package scripts….....
installer: Validating packages….....
Dec 29 12:11:05 buddy.fritz.box installer[12459] : LSExceptions [0x7fcab0a52670] loaded
Dec 29 12:11:05 buddy.fritz.box installer[12459] : PackageKit: Registered bundle file:///Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/lib/missioncontrol/Java%20Mission%20Control.app/ for uid 0
Dec 29 12:11:06 buddy.fritz.box installer[12459] : PackageKit: Registered bundle file:///Library/Internet%20Plug-Ins/JavaAppletPlugin.plugin/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/ for uid 0
Dec 29 12:11:06 buddy.fritz.box installer[12459] : PackageKit: Registered bundle file:///Library/Internet%20Plug-Ins/JavaAppletPlugin.plugin/Contents/Resources/Java%20Updater.app/ for uid 0
#
installer:  Running installer actions…
Dec 29 12:11:06 buddy.fritz.box installer[12459] : Running install actions
installer:
installer: Finishing the Installation….....
Dec 29 12:11:06 buddy.fritz.box installer[12459] : Removing temporary directory "/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//Install.12459GS2WWn"
Dec 29 12:11:06 buddy.fritz.box installer[12459] : Finalize disk "Macintosh HD"
Dec 29 12:11:06 buddy.fritz.box installer[12459] : Notifying system of updated components
Dec 29 12:11:06 buddy.fritz.box installer[12459] :
Dec 29 12:11:06 buddy.fritz.box installer[12459] : **** Summary Information ****
Dec 29 12:11:06 buddy.fritz.box installer[12459] :   Operation      Elapsed time
Dec 29 12:11:06 buddy.fritz.box installer[12459] : -----------------------------
Dec 29 12:11:06 buddy.fritz.box installer[12459] :        disk      0.05 seconds
Dec 29 12:11:06 buddy.fritz.box installer[12459] :      script      0.00 seconds
Dec 29 12:11:06 buddy.fritz.box installer[12459] :        zero      0.01 seconds
Dec 29 12:11:06 buddy.fritz.box installer[12459] :     install      6.08 seconds
Dec 29 12:11:06 buddy.fritz.box installer[12459] :     -total-      6.14 seconds
Dec 29 12:11:06 buddy.fritz.box installer[12459] :
installer:
#
installer: The software was successfully installed......
installer: The install was successful.

我希望这对其他人来说也能成功

关于java - 无法在 Mac OS Yosemite 上安装 JDK 8u25,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27686593/

相关文章:

java - 无法使用 java 将值设置为 JxBrowser localstorage

java - 我正在努力在 Uno 游戏中实现 removeCardsFromHand 方法,请问我可以提供一些关于如何实现该方法的建议吗?

java - 我想在从图库中选择图像或拍照时减小图像尺寸

macos - VSCode 断点变灰

java - Line 类的 Getter 方法

java - 从文件夹 : largest, 检索最新的文件,无论日期如何

ios - 在 Swift CLI 中使用 GCD

objective-c - 使 NSView 调整大小而不调整其中包含的图像大小

c++ - 从 OSx 上的自定义 url 打开 carbon c++ 程序

macos - 实现自定义绘制 NSMenuItem View 的直接方法