Cannot install JDK 7 on macOS Sierra 10.12.6
Solution 1:
Similar to what @klanomath suggests:
- Copy the pkg off the disk image so it can be edited.
- Extract pkg contents in Terminal (assumes "JDK 7 Update 67.pkg" is your pkg name):
pkgutil --expand JDK\ 7\ Update\ 67.pkg JDK\ 7\ Update\ 67.unpkg
- Edit the Distribution file with your favorite text editor.
- Change the return value of pm_install_check() to always be true.
function pm_install_check() { return true; }
- Save the Distribution file.
- Back in Terminal:
pkgutil --flatten JDK\ 7\ Update\ 67.unpkg JDK\ 7\ Update\ 67.new.pkg
- Run/Open the new pkg file.
Solution 2:
The check is performed by the pm_install_check()
function in the package's Distribution.
- Copy the pkg off the disk image so it can be edited
- Open it with The Archive Browser
- Edit the Distribution file with TextEdit (right-click on Distribution and choose Open With to edit the file in place).
-
Remove the following lines so the function always returns true.
Save the file and open the pkg.
Solution 3:
This is an obvious thing to happen, cause JDK 7 was made for previous versions of macOS. You need to use JDK 8 in order to successfully install it on your current macOS version. Check Here: Java SE Development Kit 8 Downloads