我下载JRE8从Oracle网站( jre-8u25-macosx-x64.dmg
)。 然后我打开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.'.