Java 8 on Yosemite
After installing Java 8 on Yosemite, I was still stuck with Java 6 from Apple website. The solution was to do the following
$ sudo rm /usr/bin
$ sudo ln -s /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin/java