Comp201: Principles of Object-Oriented Programming I
Spring 2005 -- Projects in DrJava   


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.

 

 


Last Revised Thursday, 03-Jun-2010 09:50:08 CDT

2005 Stephen Wong and Dung Nguyen