[Texas PLT logo]

COMP 202: Principles of Object-Oriented Programming II

  DrJava Project Facility  

DrJava's Project facility allows the developer to organize their work into a cohesive unit.   It allows the developer to

Creating a Project in DrJava

  1. First create a directory that will hold all the code and supplemental materials for your project. Use a folder name that is relevant to the project.
  2. Below that directory, make two subdirectories:
    1. src -- holds all the Java source files.   Put any existing source code you have in here.  If the code is in a package, then put the entire package directory here.
    2. classes -- holds all the compiled class files.
  3. Start DrJava and select Project/New...
  4. Save the project in the project folder you created, using an appropriate name.
  5. Go to Project/Project Preferences and set the Build Directory to be the classes directory you made above.
  6. If you know what class holds the main() function, set the Main Document field to that class in the src directory.
  7. Go to File/Open Folder... and open the src directory.   This will bring in any existing code that you have.

 

Adding a File to the Project

Compiling the Project

Testing the Project

Clearing the compiled files

This feature is useful when zipping up project directories when you don't wish to include the compiled class files.

 

  DrJava Project Facility  

URL: http://www.clear.rice.edu/comp202/08-fall/info/drjavaproject.shtml
Copyright © 2008-2010 Mathias Ricken and Stephen Wong