AspectJTM Compiler and Core Tools

Version 1.0.5 released on June 27, 2002.

1 Contents of this Package


2 Install Procedure

After finishing automatic installation, we recommend that you perform the following steps to complete your installation:

2.1 Add <aspectj install dir>/lib/aspectjrt.jar to your class path

This 26KB .jar file contains several small classes that are required to compile programs with the ajc compiler, and are the only extra classes necessary to run programs compiled with the ajc compiler. You must have these classes somewhere on your class path when running programs compiled with ajc. For detailed instructions please see the Configuration Instructions at the bottom of this document.

2.2 Put the AspectJ bin directory on your PATH

Modify your PATH to include <aspectj install dir>/bin. This will make it easier to run ajc and ajdoc. For detailed instructions please see the Configuration Instructions at the bottom of this document.

2.3 Download the documentation and examples from http://aspectj.org/dl

A tutorial, primer, design notes and example programs are all available for download at http://aspectj.org/dl. We strongly recommend that you download a copy of this material to understand how to use this new language.

If you did not use the automatic installation process, you may wish to create short launch scripts to start ajc and ajdoc easily (section 3).


3. Running the Tools

If you did not use the automatic installation process or the default launch scripts do not work on your system, you may wish to create short launch scripts to start ajc and ajdoc easily.

These scripts use full paths that are system dependent so you will likely have to change these. ajc is used as an example but are also applicable to ajdoc.

Here's a sample launch script for WinNT and Win2K (note that this is single line in the .bat file):

C:\jdk1.3\bin\java.exe -classpath D:\jdk1.3\lib\tools.jar;D:\aspectj0.7\lib\aspectjtools.jar -Xmx64M org.aspectj.tools.ajc.Main %*

Here's a sample launch script for a Unix shell (on Linux using Sun's JDK1.3):

/usr/java/jdk1.3/jre/bin/java -classpath /usr/java/jdk1.3/lib/tools.jar:/home/aspectj0.7/lib/aspectjtools.jar -Xmx64M org.aspectj.tools.ajc.Main "$@"

4. Configuration Instructions

4.1 Adding <aspectj install dir>/lib/aspectjrt.jar to your classpath

There are several ways to add this jar file to your classpath:

4.2 Setting the Environment Variables on Windows

The following instructions use the PATH variable as an example, but this process is identical for the CLASSPATH variable.

You can do the variables permanently for all the shells that you will run or temporarily only for the current shell. To change the PATH only in the current shell, and assuming you've installed AspectJ in C:\apps\aspectj, type:

> set PATH=%PATH%;C:\apps\aspectj\bin

Changing Environment Variables Permanently on WinNT and Win2000

Changing Environment Variables Permanently on Win9x