Dr. Java
Instructions for Installing DrJava
- Download drjava.zip file from the following location:
http://www.cs.trincoll.edu/~tdelaner/drjava/
- Extract the folder into your home directory, by either:
- Clicking on the file; or
- Running the unzip drjava.zip command in a terminal window.
- Go to your home directory and run the command ./setup in a terminal window (required just once). This will install DrJava into your home directory.
- If you would like DrJava installed in your cpsc115 directory, copy the drjava.zip file into that directory and follow steps 2 and 3 in this directory.
- The application can be run by typing: ./drjava (when in the folder) or /home/username/drjava/drjava if you installed DrJava in your home directory.
Instructions for Running DrJava
- Start DrJava by typing: ./drjava (when in the folder) or /home/username/drjava/drjava if you installed DrJava in your home directory.
- DrJava will begin with an open file called Untitled.
- Enter your Java code for a new class (or use File/Open to open an existing file.
- Save your code using the File/Save As option. Select the location to store your code. I suggest that you create a separate directory under your cpsc115 directory for each lab.
- To compile the code, press the Compile button along the top of the DrJava screen.
- If you have errors, the lines that have syntax errors will be highlighted in yellow and the error itself will be displayed in the Compiler Output window at the bottom of the screen.
- As you correct the errors, the yellow highlighting will disappear.
- Correct all errors until you get a clean compile.
- Execute your code by pressing the Run button along the top of the DrJava screen.
- You should see your output in the Console window along the bottom of the DrJava screen (click the Console) tab.
More help:
- Quick Start guide to DrJava.
- Full User Guide to DrJava.
Resources
These are links to tools, debugging hints, and libraries that you may find useful.
- CodeLab Site of Codelab assignments.
- DrJava a is a lightweight development environment for writing Java programs. It helps in organizing classes and identification of errors.
- Java Error Syntax Wiki Wiki started by Kate Sherwood to help people understand and fix syntax errors more quickly.
- Java Debugging Videos This is a collection of videos explaining various Java bugs and how to fix them.