2014-12-25 86 views
1

我從Oracle站點(jre-8u25-macosx-x64.dmg)下載了JRE8。然後我打開dmg並運行安裝。安裝進度開始,但隨後發生瞭如下錯誤:無法在OS X上安裝JRE8/JRE7優勝美地

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.'. 
+0

嘗試使用DiskUtility修復磁盤權限,然後再次運行安裝程序。如果問題仍然存在,請不要關閉安裝程序,而是按下'Command-L'(⌘L)'併發布日誌結果。 –

+0

@ l'l l我做了你所說的一切 – ZhekaKozlov

+0

@ l'l l你的意思是pkg,而不是dmg?我運行'md5/Users//Desktop/Java \ 8 \ Update \ 25.pkg',得到了不同的總和,而不是'2a93 ...'(我得到了'90f4 ...') – ZhekaKozlov

回答

3

看來要麼你需要更新的Java的版本的蘋果,或安裝程序以某種方式下載後得到打亂。這個問題通常可以固定通過運行更新工具,並從終端重新下載的JRE包:

打開終端,並運行這些命令:

softwareupdate -ir 

檢查是否真實需要/更新Apple的Java版本吧。

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磁盤映像下載到您的桌面。

mkdir ~/desktop/jre 
hdiutil attach -mountpoint ~/desktop/jre jre-8u25-macosx-x64.dmg 

安裝磁盤映像。

sudo installer -pkg ~/desktop/jre/Java\ 8\ Update\ 25.pkg -target/

安裝JRE軟件包。

hdiutil detach ~/desktop/jre 

卸載磁盤。

java -version 

檢查Java版本。

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) 
+0

@I'L'I,sudo安裝程序命令提供給我以下內容:'installer:Error - 您正在嘗試安裝Java 8 Update 25,但是已經安裝了Java 8 Update 77 build 03',但是'java -version'命令說'-bash:java:command not found'。 – psun

+1

我收到一個錯誤'installer:升級失敗(安裝程序遇到一個錯誤,導致安裝失敗,請聯繫軟件製造商尋求幫助。)'當我執行'sudo installer -pkg〜/ desktop/jre/Java \ 8 \ Update \ 25.pkg -target /' –

相關問題