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. For the beta release of DrJava (2005), use J2SE 5.0 (JDK 5.0). If you choose to use the current stable release of DrJava (03/26/2004), then use J2SE 1.4.2 instead of 5.0.

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. (See the Popular Downloads link on the right side of that page.) Choose J2SE 5.0 or J2SE 1.4.2 depending on which version of DrJava you will use. Several download options will be offered. Choose the J2SE JDK or SDK (not just the JRE and not the "bundles" that include other programming environments, such as netBeans).

Downloading DrJava

Download DrJava by clicking this link. The page will show you several versions of DrJava. Use the new beta release (you will need JDK5.0) or the current stable release (you will need JDK1.4.2). On a Windows PC, click on Beta (or Stable) Windows App (first save and then run the .exe file). 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. As long as you have followed the links from the DrJava website, you can continue with the download. (Or check the information given in the dialogs to make sure.)
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.

A common DrJava problem: finding tools.jar
This is a file that comes with the JDK. The usual location is

    C:\Program Files\Java\jdk1.5.0_02\lib\tools.jar 
if you have followed the default options during the JDK download process. You can also use a desktop tool to search for this file on your computer. You simply need to set DrJava's Preferences to the correct path. 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.