JDK 1.7 install on OS X 10.10 Yosemite fails with wrong version number

Sun was clever enough to probably use a String-compare instead of a number-check to validate if the OS X version is greater than 10.1 and as such a JDK 1.7 install fails on OS X 10.10. There is no fix/patch from Sun and for most of us it is impossible to switch to JDK 1.8.

As a work-around, we will just need to change the OS X version number to 10.9, install Java and then reset it back:

  • Change the OS X version from 10.10 to 10.9:

sudo sed -i ” ‘s/>10.10</>10.9</’ /System/Library/CoreServices/SystemVersion.plist

  • Install JDK 1.7
  • Change the OS X version from 10.9 back to 10.10:

sudo sed -i ” ‘s/>10.9</>10.10</’ /System/Library/CoreServices/SystemVersion.plist