If you want to install Java 7 on OS X 10.10 you probably already came across this annoying message:
There is an easy way to fix this while customizing the installer and disabling the OS version check. Here's how to do so:
- Download the latest Java 7 dmg from Oracle.
- Open and mount the downloaded image
- Open a new window in the Terminal.app
- Based on the downloaded version adjust the varibale below which will help us during the following customization:
JAVABUILD="67"
- Unpack the installer:
pkgutil --expand "/Volumes/JDK 7 Update ${JAVABUILD}/JDK 7 Update ${JAVABUILD}.pkg" "/tmp/JDK 7 Update ${JAVABUILD}.unpkg"
- Remove the OS version check in the
Distribution
file:
sed -i '' 's/<installation-check script="pm_install_check();"\/>//g' "/tmp/JDK 7 Update ${JAVABUILD}.unpkg/Distribution"
- Rebuild the customized image:
pkgutil --flatten "/tmp/JDK 7 Update ${JAVABUILD}.unpkg" "/tmp/JDK 7 Update ${JAVABUILD}.pkg"
- Open the image:
open "/tmp/JDK 7 Update ${JAVABUILD}.pkg"
Voilà!