Installing Java on a Windows Machine
N.B.: You should only have to do this on a home machine; Java and NetBeans are already installed on all Lab machines.
N.B.: I am a Linux and Windows guy; I don't know too much about doing this on a Mac. I believe it's fairly similar to the procedures described below. If anyone has more detailed info, please let me know, and I will post it here.
Option 1 (the easy option): install an "integrated development environment," or IDE, bundled with Java1) Find an IDE you like. There are several options, but I would recommend NetBeans for this course, since that is the same as the one installed on all of the lab machines. I personally like Eclipse, but they mostly have the same features and performance, and they're both free.
2) Download and install the software. A NetBeans plus Java JDK bundle is available here.
NOTE: If you already hava a Java Developer Kit (JDK) installed on your machine, you may not want to install the bundled NetBeans+JDK, since that will install another copy of the JDK. It tends to confuse Windows when you have multiple JDKs installed. However, most people do not already have a JDK installed (although most people DO have a Java Runtime Environment, or JRE, installed, which is not a problem). You can check to see if you have a JDK installed by looking for a folder whose name starts with "jdk" in the C:\Program Files\Java directory, or by checking your "Add and Remove Programs" tool in the Control Panel. If you do have a JDK installed, you can download a NetBeans without JDK from the NetBeans website. If you're not sure, go ahead and install the bundled NetBeans+JDK; it's not likely to cause major problems.
Option 2 (the harder option): manually install Java
This option saves you some disk space, since you won't have to install the files associated with the IDE. Otherwise, it's not recommended.1) If you don't already have it (see note above), you will need to download the Java Development Kit (JDK) from Oracle, the company that maintains Java. The most recent release is available from
You should click on the "Download" button next to the latest JDK, which as of the time that I'm writing this is "JDK 7" next to the entry for "Java SE 7" (any JDK version past JDK 6 is fine; we will be assuming JDK 6 during class but for what we're talking about it's not substantially different from JDK 7).
On the next page, click the radio button for "Accept License Agreement".
After the page reloads, click on the link for "Windows x86 79.48 MB jdk-7-windows-i586.exe" (if you're running a 32-bit machine) or "Windows x64 80.25 MB jdk-7-windows-x64.exe" (if you're running a 64-bit machine). If you're not sure whether your machine is 32-bit or 64-bit, look at this page first:
When the dialog box opens, click on "Save File".
2) After the JDK finishes downloading (it may take a little while, depending on your internet connection speed; it is around 70MB), you will need to run it to install Java on your machine. Simply click through all the default options during the installation.
3) Figure out the directory (folder) where the JDK is installed. By default, if you downloaded JDK 6 Update 27, this directory is "C:\Progam Files\Java\jdk1.6.0_27\bin\", but it may be different if you did not use the default options during the installation, or if you downloaded a different JDK. You can check if this is the right directory by opening this folder. If the folder exists, and it contains the files "java.exe" and "javac.exe", along with a number of other things, then it's the right folder.
4) The last thing you need to do is let Windows know where to find "java" and "javac".
Open the Start Menu, go to Settings, and click on "Control Panel".
Click on the icon for "System".
On Windows XP, you should see a screen that says "System Properties" at the top. Click on the tab for "Advanced". Then click on the button that says "Environment Variables".
On the next screen, you should see two lists of "variables", the first one called "User Variables" and the second one called "System variables". In the "System variables" list, scroll down until you find the entry for "Path" (not "CLASSPATH" or "PATHEXT" or anything else, just "Path"). Click once on the entry to highlight it, and then click the "Edit" button.
Where it says "variable value", do the following: DO NOT DELETE ANYTHING. (If you delete anything, hit the Cancel button and try again.) Scroll to the very beginning of the entry. Enter the folder name where Java was installed (again, it is probably C:\Progam Files\Java\jdk1.6.0_27\bin\), followed by a semicolon (;). Hit the OK button. The screen will close. Hit the OK button on the next screen. That screen will close. Finally, hit the OK button on the last screen.
5) That's it. You should now be able to run "javac" and "java" from the command prompt.