AspectJ Setup and Usage at CCS

Setup

In order to be able to use the AspectJ compiler and tools from your CCS account you need to first complete the following steps:
  1. Add /proj/demsys/demjava/packages/ajc/bin to your PATH environment variable
    • You can do this by adding the following line to your .software file.
      PATH=/proj/demsys/demjava/packages/ajc/bin
    • If you do not have a .software file then you have to append the above directory to your PATH variable in your shell's initialization file.
  2. Add /proj/demsys/demjava/packages/ajc/lib/aspectjrt.jar to your CLASSPATH environment variable.
    • You can do this by adding the following line to your .software file.
      CLASSPATH=/proj/demsys/demjava/packages/ajc/lib/aspectjrt.jar
    • If you do not have a .software file then you have to append the above directory to your CLASSPATH variable in your shell's initialization file.

Testing your Setup

To test your setup for AspectJ type the following at your shell prompt:

ajc -version

To compile a bunch of Java files use ajc *.java

To find out about how AspectJ compiles the code, use ajc -preprocess *.java and inspect the ajworkingdir directory.

For information on compiler options as well as AspectJ in general visit The AspectJ Web Page