Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Lab 09 – List Visitors

Setting up a DrJava Project

DrJava has the ability to create "projects" which enable you to efficiently manage the large numbers of source and compiled files that a Java application involves.   A good project structure separates the source code from the compiled code and enables the user to work open all the required source files at once and to easily add/delete/edit them.

A DrJava project involves several pieces:

  1. A well-defined directory (folder) structure:
    • Project directory, containing the DrJava project file and below it:
      • "src" -- the "source" directory which holds the "XXX.java" files
      • "classes" or "bin" directory which holds the compiled "XXX.class" files
  2. The DrJava ("XXX.drjava") file, which holds the information about what files are in the project and other project-related data.

To set up a DrJava project:

  1. On your hard disk, create a folder to hold your project, e.g. "Lab09".   It's easiest to build the "src" and "classes" subdirectories at this point, or you can wait until step 4 below.
  2. Click on Project/New
  3. Browse to the project folder and save your DrJava project file with an appropriate name, e.g. "Lab09.drjava"  (DrJava will automatically add the file extension).
  4.  In the Project Properties dialog that comes up, fill out the following fields.   You will need to click the "..." button to browse to and create the directories if they do not already exist.
    • Wiki Markup
      Project Root = \[project folder\]\src     e.g. "U:\Comp211\Lab09\src"
    • Wiki Markup
      Build Directory =  \[project folder\]\classes   e.g.  "U:\Comp211\Lab09\classes"
    • Wiki Markup
      Working Directory = \[project folder\]\classes   e.g.  "U:\Comp211\Lab09\classes"
  5. Leave the rest of the fields blank for now and click "Ok"

To open a project, click on "Project/Open..." in DrJava and browse to your XXX.drjava project file.    If your computer is set up to do it, you might also be able to automatically open a DrJava project by simply double-clicking the project file.

To turn in your project-based work, simply zip up the entire project folder and submit the zip file.

Limitations of the Interpreter Design Pattern

...