© Copyright 1998 - 2000 XEROX Corporation. All rights reserved.

AspectJ Development Environment Support for Borland® JBuilderTM

Contents

1. Overview
2. IDE Window and AspectJ Structure View
3. AspectJ Console (JBuilder 3.5)
4. Setting up, compiling, and running Spacewar in JBuilder 4
5. Setting up, compiling, and running Spacewar in JBuilder 3.5

1 Overview

AspectJ Development Environment (AJDE) support for JBuilder is an extension to Borland's JBuilder.  AJDE for JBuilder will allow you to


2 IDE Window and AspectJ Structure View

The following figure demonstrates a typical view of AspectJ Support for JBuilder running:

  1. The AspectJ Support for JBuilder buttons
    1. The "AJ" button opens the Structure View
    2. This button launches the AspectJ Support for AspectJ Console
    3. The "compile with ajc" button
    4. The "run" button
  2. The Structure View showing the structure for the currently selected class
  3. The structure view navigation and auto-arrange buttons

3 AspectJ Console (JBuilder 3.5)

  1. Configuration tab
  2. Messages tab
  3. "Debug.java" removed from the files passed to ajc

4 Setting up, Compiling, and Running Spacewar in JBuilder 4

To set up the examples/spacewar example (available for download at the bottom of the  Download Page) you can use the following steps as a guideline:

Step 1: set up Spacewar as a JBuilder project

Step 2: adding "aspectjrt.jar" as a project library

Step 3: adding sources to your project

Step 4: setting up the build configuration and compiling

 Step 5: running the Spacewar example
 

5 Setting up, Compiling, and Running in JBuilder 3.5

To set up the examples/spacewar example (available for download at the bottom of the  Download Page) you can use the following steps as a guideline:

  1. launch JBuilder 3.5
  2. in the "File" menu select "New project"
    1. click "Browse" and locate the "aspectj/examples" directory
    2. type "Spacewar.jpr" into the dialog box to save the project file in that directory (note, since the Spacewar example uses both the "spacewar" and "coordination" packages the project is set up in the root examples directory) and click "Save" to close the "New Project File" dialog box
    3. click "Finish"
  3. in the "Project" menu select "Project properties..."
    1. set the "Output path" entry to be the directory where you want your classes to go
    2. in the "Source" tab select the entry and click "Edit" (by default JBuilder will set this directory to be "examples/src" which does not exist)
    3. once the "Select a path" dialog appears simply click "OK" since this will select the "examples" directory
    4. click "OK" to close the "Project Properties" dialog
  4. in the leftmost pane you will notice "Spacewar.jpr", right click this and select "Add to project" in the popup, then "Add class/package..." in the next popup
  5. <cntrl> click "spacewar" and "coordination" and then click "OK"; this will add the two packages to your project
  6. open the AspectJ Support for JBuilder Console
  7. you can remove "Debug.java" (this aspect adds considerable overhead to the compile) by clicking it, then click "OK" to save the build configuration and close the console
  8. click the "Compile" button to compile the project
  9. open the Structure View to browse the structure of the program
  10. click the "Run" button to play Spacewar
    1. if you have not selected a class to run, you will be prompted to do so: click "OK" in the prompt dialog, then 
    2. in the "Project Properties" dialog that pops up select the "Run" tab
    3. under "Application" click "Set..."
    4. open up the "spacewar" package, select "Game" and click "OK"