Download the proper version of the Java JDK (Java Platform, Standard Edition) and install it. JDK stands for "Java Development Kit" and it contains both a Java compiler (for compiling into into executable form the programs you write) and a Java runtime environment (for actually running compiled programs). Most of you probably have a Java runtime environment on your machine (this is used to do things like run Java apps in web pages, Java programs that other people have written and compiled, etc.), but you probably do not have the Java compiler, so you need to get it.
You can get the JDK for your machine at the Sun Java download site. For Fall 2010, this will be "JDK 6 Update 22" near the page top.
Place the downloaded file on your desktop, and when it is complete, double click on it and the script will take you through the steps for installing the Java JDK. The JDK will give you the latest compiler ("javac") and the latest runtime environment ("java") containing the JVM (java virtual machine). Your computer probably has a java runtime environment, but it may not be the latest.
Mac users, choose the MAC OS X button at the same page.