Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

This tutorial does not explain AOP, however if your new to the idea of AOP, then please check out JavaWorld's series of articles to get you started.

Installation

Download the latest release and unzip it into the relevant location. This tutorial is based on 0.10.
The latest distribution can be found here.

After installation you need to set the ASPECTWERKZ_HOME environment variable to point to the installation directory. This is because quite a few of the scripts use this to find the required libraries. How this variable is set depends on you OS. Since I'm using Linux I've amended my .bashrc file, windows users could do this by using the control panel.

The Test Application
Now we've installed aspectwerkz, we need a test application into which to weave our aspects. As is the tradition, I'm going to use the standard HelloWorld application.

package testAOP;

public class HelloWorld {

public static void main(String args[])

Unknown macro: { HelloWorld world = new HellWorld(); world.greet(); }

public void greet()

Unknown macro: { System.out.println("Hello World"); }

}

This is simply a standard Java application, and can be compiled with javac -d target HelloWorld.java

  • No labels