Install Java on a Windows machine

Check to see if you already have Java installed.

Look in Program Files, or Program Files (x86) to see if you have a java directory, containing the jdk. If so, you have Java installed. If not, install it.

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

 

Add the java bin directory to your PATH

You will execute Java programs from the command line. To open a command window, click on the Start menu and type "cmd" in the text box. Open a command window and type:

javac -version

If java is installed, and the location of java is in your PATH, you will learn what version. If you get a "command not found", you need to add java's directory to your PATH, which is an environment variable.

To locate directory where Java is, look in Program Files, or Program Files (x86) to see if you have a java directory, with the jdk. Make a note of the path to get to the bin directory. (To do this, you could: Click the java directory, click the bin directory, click the directory bar at the top of the window where you will see the path, and use Ctrl+C to copy this directory name).

Next, find the Control Panel for Environment Variables. There are different ways to find this on different versions of windows. If you can't find it, this site may help. You want to create a NEW environmental variable. DO NOT edit the values of existing ones. Once you locate the Enviroment Variables contol panel, create a new user variable (top box).

In the Edit User Variable box put: PATH

and then in Variable Value box paste the path of the bin directory, which will look something like this:
C:\Program Files\Java\jdk1.8.0_60\bin;