Install Java on a Mac

Check to see if you already have Java installed.

If you are using a Mac you will use the Terminal application to execute Java programs. To see if you have a java compiler installed, open a terminal window and type:

javac -version

If you have javac installed, you'll see which version. If you don't, you'll get a command not found.

 

If you don't already have Java installed, install the JDK

JDK stands for Java Development Kit, and it includes the Java compiler (javac).
The JDK requires a little over half a gig of disk space. Download the JDK here:

http://www.oracle.com/technetwork/java/javase/downloads/index.html