If you only want to install the latest official JRE from Oracle, you can get it there, install it, and export the new JAVA_HOME in the terminal.
java -version
gives you an error and a popupexport JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
java -version
now gives you java version "1.7.0_45"
That's the cleanest way I found to install the latest JRE.
You can add the export JAVA_HOME
line in your .bashrc
to have java
permanently in your Terminal:
echo export JAVA_HOME=\"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home\" >> ~/.bashrc