The command ajc compiles AspectJ and Java language source files into class files. Options and files may be specified directly on the command line, or indirectly by naming a file which contains them.
The arguments after the options specify the file(s) to compile. Files may be listed directly on the command line, or listed in a file. The @file and -argfile file forms are equivalent, and are interpreted as meaning all the files listed in the specified file. Each line in these files should contain one option or filename. Comments, as in Java, start with // and extend to the end of the line.
Don't generate any comments into the woven code. Only relevant with -preprocess mode.
Don't try to generate any .class files. Generate regular Java code into workingdir
Specify where to place intermediate .java files Directory defaults to ./ajworkingdir. Only relevant with -usejavac or -preprocess modes.
Specify where to place generated .class files Directory defaults to the current working dir
the file is a line-delimited list of arguments these arguments are inserted into the argument list
Be extra-lenient in interpreting the java specification This allows some statements that some compilers consider errors.
Be extra-strict in interpreting the java specification This signals errors for some statements that many compilers don't catch.
ajc accepts source files with either the .java extension or the .aj extension. We normally use .java for all of our files in an AspectJ system -- files that contain aspects as well as files that contain classes. However, if you have a need to mechanically distinguish files that use AspectJ's additional functionality from those that are pure Java we recommend using the .aj extension for those files.
We'd like to discourage other means of mechanical distinction such as naming conventions or sub-packages in favor of the .aj extension.
AspectJ is a compatible extension to the Java programming language. The AspectJ compiler adheres to the The Java Language Specfication, Second Edition and to the The Java Virtual Machine Specification, Second Edition and runs on any Java 2 compatible platform. The code it generates runs on any Java 1.1 or later compatible platform.
The AspectJ compiler is implemented completely in Java and can be called as a Java class. The only interface that should be considered public is the method org.aspectj.tools.ajc.Main.main(String[] args) where args are the standard ajc command line arguments. This means that an alternative way to run the compiler is
You must additionally include tools.jar from your Java developer's kit in your classpath.