Confirm that both the AspectJ and AJDT plugins have been successfully installed:
From the help menu, select “About Eclipse Platform,” and then click on “Plug-in Details”
You should see the org.aspectj.ajde plugin listed at version 1.0.6. (Note the image below is out of date and shows a 1.0.5 version plugin)
...and the org.eclipse.ajdt.ui plugin listed at version 0.5.2.. (note the image below is out of date and shows a 0.5.0 version number)
Configuring the editor:
You need to configure Eclipse to use the AspectJ/Java editor for .java source files (in place of the Java editor supplied by JDT).
Select “Preferences” from the “Window” menu.
Expand the “Workbench” node, and select “File Associations.” In the pane on the right of the dialog box click on “*.java.” Highlight the AspectJ/Java editor, and click on “Default.”
The AspectJ/Java editor should now be shown as the default.
Adding the New Aspect Wizard Shortcut:
Open the Java perspective, and then from the “Window“ menu select “Customize Perspective.”
Expand the “File New” branch and select the “Aspect” node (and AspectJ Project too if you like). A shortcut to create a new aspect will now appear alongside the new class wizard shortcut in the “New...” menu.
Here's how it looks:
Automatic build suppression
By default, AJDT suppresses automatic builds on resource modification (for AspectJ projects only) since AspectJ does not yet support incremental compilation. To build an AspectJ project, either select the project in the packages view and then select “Rebuild” from the project menu, or use the AspectJ build button:
AJDT supports multiple build configurations within a project (created using the New Build Configuration wizard). To select an alternate configuration for building, use the pulldown beside the build button:
No Eager Parsing
Currently there is no eager parsing support for AJDT. A consequence of this is that the outline view does not update as you edit, but instead is updated as a result of performing a build (compilation).
Running an AspectJ Program
Launch an AspectJ application using the normal Eclipse run button (running man icon). Before doing this, you need to configure your project to use the AspectJ runtime library at runtime. Select the project in the packages view, and choose "Properties" from the context menu.
Select the "Java Build Path" section, and then the "Libraries" tab. Click on "Add External JARs.."
Browse to the org.aspectj.ajde_1.0.6 directory in the "plugins" sub-directory of your Eclipse installation. Select "aspectjrt.jar" and click "Open." (Note the image below is out of date and shows the 1.0.5 plugin directory).
The project properties should now look as below, click "OK".
Breakpoints can be set in Java classes (but not in aspects). To set a breakpoint, double-click in the editor margin (the context menu option “Add Breakpoint” does not work yet). The debugger will stop at the breakpoint, but is not yet able to find the corresponding sourcecode and hence stepping through the program in conjunction with the source is not possible. This requires support for JSR 45 which is not in Eclipse 2.0. A debugging solution is a high priority item for the AJDT project.
Using existing AspectJ .lst filesThe AspectJ command line tools support a richer build configuration file format than AJDT. If you experience problems using an existing .lst file with a project inside Eclipse then opening the file in the Build Configuration Editor (double-click in packages view for example) and saving it again should correct most problems.