Oh, forgot to mention:
Yosemite compatible Apple Java which you should install
http://support.apple.com/kb/DL1572
Once this is installed the previously installed version of Oracle Java
and Apple Java will appear (this may be strange to some because Apple
Java was not appearing for many under Mavericks!) and you will then be
able to nevertheless select Java 7 (or 8 if you want to install --
http://www.oracle.com/technetwork/java/javase/downloads/index.html)