How to install Java 7 on Yosemite

An easy way is to create a copy of SystemVersion.plist from
/System/Library/CoreServices/
into your desktop.
change

<key>ProductVersion</key>
	<string>10.10</string>

to

<key>ProductVersion</key>
	<string>10.9.4</string>

put back the file to CoreServices and job done. You can now start Java 7.
You need to type your password at the prompt to authorise the process.
Restore the original string “10.10” otherwise you will encounter stability problems.

Option 2:
Change the Distribution file of the pkg file.
i. mount the dmg
ii. copy the pkg into your desktop
iii. unpack the pkg, change the Distribution file accordingly, save it, zip it and install it