首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法在OS X Yosemite上安装JRE7 8/JRE7 7

无法在OS X Yosemite上安装JRE7 8/JRE7 7
EN

Stack Overflow用户
提问于 2014-12-25 10:51:08
回答 1查看 4.6K关注 0票数 1

我从Oracle (jre-8u25-macosx-x64.dmg)下载了jre-8u25-macosx-x64.dmg。然后我打开dmg并运行安装。安装过程开始,但随后发生了以下错误:

代码语言:javascript
运行
复制
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

代码语言:javascript
运行
复制
System.out.println(System.getProperty("os.name"));

这很奇怪。有谁遇到过同样的问题吗?

更新1

我运行sudo diskutil repairPermissions /

然后我再次运行安装程序并按下⌘ + L。日志是:

代码语言:javascript
运行
复制
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.'.
EN

回答 1

Stack Overflow用户

发布于 2014-12-25 13:25:44

看起来,要么您需要更新Apple版本的Java,要么安装程序在下载它之后会出现故障。这个问题通常可以通过运行更新工具并从终端重新下载JRE包来解决:

打开终端并运行以下命令:

代码语言:javascript
运行
复制
softwareupdate -ir

如果需要,请检查/更新Apple的Java版本。

代码语言:javascript
运行
复制
cd ~/desktop
curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jre-8u25-macosx-x64.dmg > jre-8u25-macosx-x64.dmg

将JRE磁盘映像下载到桌面。

代码语言:javascript
运行
复制
mkdir ~/desktop/jre
hdiutil attach -mountpoint ~/desktop/jre jre-8u25-macosx-x64.dmg

挂载磁盘映像。

代码语言:javascript
运行
复制
sudo installer -pkg ~/desktop/jre/Java\ 8\ Update\ 25.pkg -target /

安装JRE包。

代码语言:javascript
运行
复制
hdiutil detach ~/desktop/jre

卸载磁盘。

代码语言:javascript
运行
复制
java -version

检查Java版本。

代码语言:javascript
运行
复制
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27646540

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档