You can download the Java software from the link on the course home page You want the plain "JDK" not "JRE".
To make sure it worked, type javac -version on the command line (Terminal for Mac, CMD for Windows, bash or other shell for Unix). You should get a message with the version number (preferably 1.7 or higher).
Recent Mac OS systems have Java already installed. Check that you have a fairly recent version of Java (1.7 or later). If not, then download a fresh version as above.
If you are having trouble running java, make
sure the CLASSPATH environment variable is not set. Some other
program installations may have set it automatically. In Windows, the
environment variables are in the System control panel under
Advanced / Environment Variables. You may also want to add the
directory where the javac program lives (typically something like
to your PATH environment variable.
You can add also this directory to your PATH variable temporarily,
just in a single window, by typing
PATH=%PATH%;C:\...etc... on the command line.