How to install Java and run a Java program.
Java for Windows and Linux can be downloaded from the Sun Developer Network.
Although you only need the Java Runtime Environment (JRE) to run Java programs, we recommend that you install the Java Development Kit (JDK) in order to be able to compile and build Java programs from source code. The JDK is required to use the Easy Java Simulations modeling tool.
The JDK is installed by default in OS X.