MacOS – Cannot install JDK 7 on macOS Sierra 10.12.6

javamacos

I tried to install JDK 7u67 on my MacBook Pro with macOS Sierra 10.12.6, but all I get is this error message:

Java from Oracle requires Mac OS X 10.7.3 or later.

It does not really makes sense for me, because I already have higher version, so Java should be able to install. Has anyone faced same issue, please?

Best Answer

Similar to what @klanomath suggests:

  1. Copy the pkg off the disk image so it can be edited.
  2. 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
  3. Edit the Distribution file with your favorite text editor.
  4. Change the return value of pm_install_check() to always be true.
    function pm_install_check() {
      return true;
    }
  1. Save the Distribution file.
  2. Back in Terminal: pkgutil --flatten JDK\ 7\ Update\ 67.unpkg JDK\ 7\ Update\ 67.new.pkg
  3. Run/Open the new pkg file.