CS100M --> DrJava

The Java programming environment used in CS100 is DrJava, a free Integrated Development Environment (IDE). DrJava was developed by Professor Corky Cartwright at Rice University. Both DrJava and a professional IDE called Codewarrior are installed on computers in CIT labs in the Engineering Quad.

Installation

The Java Virtual Machine

You will need the Java software development kit (JDK) from the Sun website. If you have a Macintosh with Mac OS X, you almost certainly have the JDK installed already, so you don't have to download the JDK. If you are using a PC running a version of Windows, chances are that you don't have the JDK yet, and you can download it here. Several download options will be offered. Choose JDK 5.0, the J2SE Development Kit (JDK). Be sure you're getting the JDK and not just the JRE. Do not get the "bundles" that include other programming environments, such as netBeans). Once you start the download process, you will need to accept license agreements. When prompted for installation options, accept the default options, and run the .exe file. (Only customize the installation if you know your hardware well.)

Downloading DrJava

Download DrJava by clicking this link. The page will show you several versions of DrJava. Use the Current Stable Release (runs with JDK1.5.0, see above). On a Windows PC, click on Stable Windows App. You'll be sent to select a location (mirror) from which to download DrJava. You may choose any of the mirrors, but some are busier (slower) than others. (I had good luck with the Phoenix, AZ mirror.)
Warning: you may get a dialog saying something about a security check (Internet Explorer puts a tiny little bar near the top of the browser, so watch for it). As long as you have followed the links from the DrJava website, you can continue the download (or check the information given in the dialogs to make sure). Save and then run the .exe file.
If the system tells you that it cannot find a file called tools.jar, you need to select the correct location of that file. See the usual location below:

    C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar 
You can also use a desktop tool to search for this file on your computer.

If you didn't set the correct path for the file tools.jar at installation time, set it after installation by going through DrJava's Preferences option. To do so, follow these menu items: Edit - Preferences - Resource Locations - Tools.jar Location. Then type or browse to the correct location.

Running DrJava

There are several ways to run DrJava:

  • From the command line, you can type java -jar drjava-stable-version.jar.
  • On windows system, you can double-click on the .exe file to start DrJava.
  • On many platforms, you can simply double-click the jar file to start DrJava.
  • On OS X, you can download drjava-stable-version-osx from the download page. You can then run DrJava as a normal application.

Here is documentation on using DrJava on the web. In addition, Appendix I of the text contains information on using DrJava.