Я загрузил 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.'.
Кажется, вам нужно обновить версию Java от 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)
installer: Error - You are trying to install Java 8 Update 25, however Java 8 Update 77 build 03 is already installed
но команда java -version
сообщает -bash: java: command not found
.
installer: The upgrade failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
Когда я sudo installer -pkg ~/desktop/jre/Java\ 8\ Update\ 25.pkg -target /
Command-L
( ⌘ L )
и опубликуйте результаты журнала.