Java Setup for a Mac

Java comes pre-installed on OSX and later versions of the Macintosh operating system.

Terminal is a command shell for the Mac. The link has a description of how to use the application. You will need the command shell in order to compile and execute (run) Java programs.