Installing Java on your home computer

To write Java programs you need some kind of Java development environment. There are a great number of Java development environments available. Most are complicated and designed for working on large Java projects. In this course, we will use an "educational" development environment called DrJava.

Before you can install DrJava, you must install a JDK (a Java Development Kit). We will be using the JDK 6 version of the Java SE Development Kit. The steps below tell you how to install this programming environment along with DrJava. There are roughly two parts to this installation. The first part (Step 1) is installing the JDK and the second part (Steps 2-5) is installing and configuring DrJava.

Step 1:

Install Sun's JDK 1.6. Use the link at the end of this paragraph to go to Sun's (now Oracle's) download page. You want to download the "JDK 6 Update 21", which is the first download link on the page. Be sure to click on the "Download JDK" button (not the "Download JRE" button.) That download link will take you to a page where you choose the version of your operating system (NOTE: If you have a 64-bit version of Windows Vista or 7, be sure to download the 64-bit version of the JDK). After choosing an operating system, you are taken to a page where you can download the JDK 6 installation program. After you have downloaded the installer program to your computer (be sure to notice where on your computer the installer is downloaded to), double click on the installer program to run it. Accept all of the default options that the installer program presents you with. (Sun has installation instructions that you can look at, but they are not all that helpful.)

Sun's JDK 1.6 download page

Step 2:

Use the link at the end of this paragraph to download a zip file containing a copy of the DrJava program and a number of other files that we will use in this course. Save the zip file on your desktop.

cs123.zip

Step 3:

The last step downloaded a zip file, cs123.zip. Right click on this zip file and choose "extract all" from the context menu. After unzipping this file, you will have a new folder called cs123 on your desktop. Move this folder to your C:\ drive, so that you now have the folder C:\cs123.

Step 4:

Open the folder C:\cs123. In the folder there is a program called drjava-stable-20100816-r5366.exe. This is the DrJava program. Double click on this file to run DrJava. The first time you run DrJava, it will present you with a dialog box asking if you want to associate .java files with DrJava. Click on the "Always" button. After DrJava starts, use the "File -> Quit" menu item to quit DrJava.

Step 5:

In this step we will test your DrJava installation.

Test your Java and DrJava installation by double clicking on the file Hello.java that is in the C:\cs123 directory. Step 4 associated java files with DrJava, so double clicking on the Hello.java file should open that file in DrJava. DrJava should now look something like this.

Click on DrJava's "Compile" button. You should see a "Compilation completed." message in the lower "Compiler Output" pane of the DrJava window and you should now find a new file, Hello.class, in the C:\cs123 directory. Click on DrJava's "Run" button. You should see a green "Hello world (in Java)!" message in DrJava's "Interactions" pane (this message should also be in the "Console" pane).

The Java JDK and DrJava should be installed properly at this point.

When you are editing files with DrJava, remember to save your work frequently (at least every 10 minutes), otherwise it may be Abort, Retry, Ignore?


Return to the CS 12300 home page.



compliments and criticisms