The examples source code is part of the AspectJ distribution which may be downloaded from the AspectJ project page ( http://eclipse.org/aspectj ).
Compiling most examples is straightforward. Go the
directory, and look for a InstallDir
/examples.lst
file in one of
the example subdirectories. Use the -arglist
option to ajc
to compile the example. For
instance, to compile the telecom example with billing, type
ajc -argfile telecom/billing.lst
To run the examples, your classpath must include the AspectJ run-time
Java archive (aspectjrt.jar
). You may either set the
CLASSPATH
environment variable or use the
-classpath
command line option to the Java
interpreter:
(In Unix use a : in the CLASSPATH)
java -classpath ".:InstallDir
/lib/aspectjrt.jar" telecom.billingSimulation
(In Windows use a ; in the CLASSPATH)
java -classpath ".;InstallDir
/lib/aspectjrt.jar" telecom.billingSimulation