【发布时间】:2014-12-25 21:25:44
【问题描述】:
我从 Oracle 网站 (jre-8u25-macosx-x64.dmg) 下载了 JRE8。然后我打开dmg 并运行安装。安装进度开始,但随后出现以下错误:
The installation failed.
The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
如果我尝试安装 JRE7,也会出现同样的错误。
我也尝试下载jre-7u71-macosx-x64.tar.gz 并解压,但之后Java 拒绝正常工作。 java -version 很好,但是下面的代码打印了Unknown:
System.out.println(System.getProperty("os.name"));
这很奇怪。有没有人遇到过同样的问题?
更新 1
我跑sudo diskutil repairPermissions /
然后我再次运行安装程序并按下⌘ + L。日志是:
installd[438]: PackageKit: ----- Begin install -----
installd[438]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “Java 8 Update 25.pkg”." UserInfo=0x7f8442b3a440 {NSFilePath=./postinstall, NSURL=file://localhost/Volumes/Java%208%20Update%2025/Java%208%20Update%2025.pkg#javaappletplugin.pkg, PKInstallPackageIdentifier=com.oracle.jre, NSLocalizedDescription=An error occurred while running scripts from the package “Java 8 Update 25.pkg”.} {
NSFilePath = "./postinstall";
NSLocalizedDescription = "An error occurred while running scripts from the package \U201cJava 8 Update 25.pkg\U201d.";
NSURL = "file://localhost/Volumes/Java%208%20Update%2025/Java%208%20Update%2025.pkg#javaappletplugin.pkg";
PKInstallPackageIdentifier = "com.oracle.jre";
}
Installer[1667]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
Installer[1667]: Displaying 'Install Failed' UI.
Installer[1667]: 'Install Failed' UI displayed message:'The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.'.
【问题讨论】:
-
尝试使用 DiskUtility 修复您的磁盘权限,然后再次运行安装程序。如果问题仍然存在,请不要关闭安装程序,而是按
Command-L( ⌘ L )并发布日志结果。 -
@l'L'l 我照你说的做了
-
@l'L'l 你的意思是 pkg,而不是 dmg?我运行
md5 /Users/<user_name>/Desktop/Java\ 8\ Update\ 25.pkg得到了不同的总和,而不是2a93...(我得到了90f4...) -
是的,
.dmg是2a93...和.pkg是90f4...- 尝试从您的桌面运行.pkg或使用我的答案中的终端说明,看看您是否成功.如果这些都不起作用,我唯一的其他直接建议是从终端重建启动服务:/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user -
@l'L'l 执行了您在回答中所说的一切。得到同样的错误。然后运行
/System/Library/Frameworks/...,但没有帮助。
标签: java macos osx-yosemite