

The third line is not required, but makes the file more user-friendly if you open it again in a text editor. The second line fixes a permissions issue create by using defaults write.

The instructions below should also work for future updates to the JRE, so no need to worry about having to find and update version numbers in the code for an update this time! Installing the JDK is actually simpler because Oracle includes an installer which does a few of the steps for you, so some people may actually prefer those instructions. In case you want clearer instructions for the JDK, I have also created another post for installing the JDK if that’s what you require. El Capitan has been released, and because my previous Java post got a lot more traffic than I expected, I’ve decided to consolidate all the information from it and create a guide for installing just the JRE (Java Runtime Environment).
