What is AJDT? The AspectJ Development Tools project (AJDT) is a set of plug-ins for Eclipse that provide support for aspect-oriented software development using AspectJ within the Eclipse IDE.

−

The AspectJ Development Tools project (AJDT) is a set of plug-ins for Eclipse that provide support for aspect-oriented software development using AspectJ within the Eclipse IDE.

+

−

===Who develops AJDT?===

+

=== Who develops AJDT? ===

−

AJDT is an open-source project hosted on eclipse.org, current contributors are listed on the website. Anyone can get involved, see How can I contribute to the AJDT project?

+

−

===How does AJDT relate to the AspectJ project?===

+

AJDT is an open-source project hosted on eclipse.org, current contributors are listed on the website. Anyone can get involved, see How can I contribute to the AJDT project?

−

AJDT provides Eclipse IDE integration for AspectJ, and includes the AJDE (AspectJ Development Environment) libraries from the AspectJ project as part of its packaging. Development of the AspectJ compiler and AJDE takes place under the AspectJ project.

+

−

==Community==

+

=== How does AJDT relate to the AspectJ project? ===

−

===Is there an AJDT mailing list?===

+

AJDT provides Eclipse IDE integration for AspectJ, and includes the AJDE (AspectJ Development Environment) libraries from the AspectJ project as part of its packaging. Development of the AspectJ compiler and AJDE takes place under the AspectJ project.

−

AJDT has a developers mailing list, ajdt-dev@dev.eclipse.org, with archives and subscription information available online. Questions regarding the use of AspectJ the language are best directed to the AspectJ users mailing list.

+

−

===Are there any newsgroups for AJDT users?===

+

== Community ==

−

AJDT is supported through the eclipse.technology.ajdt newsgroup. A web interface is also available.

+

−

===What do I do if I think I've found a bug in AJDT?===

+

=== Is there an AJDT mailing list? ===

−

First check the bug database to see if you've hit a known problem. If it appears to be a genuinely new bug, please submit a bug report on AJDT using bugzilla following the bug reporting guidelines.

+

−

===Extra useful information to include in an AJDT bug report:===

+

AJDT has a developers mailing list, ajdt-dev@dev.eclipse.org, with archives and subscription information available online. Questions regarding the use of AspectJ the language are best directed to the AspectJ users mailing list.

−

Information from the AJDT Event Trace view. This view displays a lot of diagnositc information about the execution of the plug-in, for example, it will show you the exact classpaths being used for compilation, the time spent in the compiler. To open the AJDT Event Trace go to Window > Show view > Other... > AspectJ > AJDT Event Trace.

+

=== Are there any newsgroups for AJDT users? ===

−

===How can I request a new feature in AJDT?===

+

AJDT is supported through the eclipse.technology.ajdt newsgroup. A web interface is also available.

−

Informal requests can be posted to the newsgroup or mailing list. Formal requests can be made by raising an AJDT enhancement request on Bugzilla.

+

−

==Using AJDT==

+

=== What do I do if I think I've found a bug in AJDT? ===

−

===What version of AJDT do I need?===

+

First check the bug database to see if you've hit a known problem. If it appears to be a genuinely new bug, please submit a bug report on AJDT using bugzilla following the bug reporting guidelines.

−

The recommended version of AJDT depends on the version of Eclipse that you are using. Eclipse 3.4 requires AJDT 1.6, Eclipse 3.3 requires AJDT 1.5, and Eclipse 3.2 requires AJDT 1.4 (etc.). Typically, the latest development version is just as stable as our official releases (we never release anything unless anything unless it passes all tests). You can find the latest development release as well as all of the official AJDT release from the AJDT downloads page.

+

−

===Why aren't AspectJ keywords highlighted in the editor?===

+

=== Extra useful information to include in an AJDT bug report: ===

−

The most common cause of this problem is having AspectJ constructs in Java files (files with the .java extension) and using the JDT's Java Editor. Aspects and AspectJ constructs should be contained in .aj files which are opened with the AspectJ Editor, an extension to the Java Editor.

+

−

===How can I debug AspectJ programs in Eclipse?===

+

Information from the AJDT Event Trace view. This view displays a lot of diagnositc information about the execution of the plug-in, for example, it will show you the exact classpaths being used for compilation, the time spent in the compiler. To open the AJDT Event Trace go to Window &gt; Show view &gt; Other... &gt; AspectJ &gt; AJDT Event Trace.

−

AspectJ programs can be run in the debugger in the same way as Java programs. The tools enable the user to step into, through and out of advice. The AspectJ development tools also provide the facility to set breakpoints in aspects.

+

−

===Why don't breakpoints in around advice work?===

+

=== How can I request a new feature in AJDT? ===

−

Around advice is inlined by the weaver by default, which means that breakpoints set in the declaring aspect are not detected. To disable inlining select Window > Preferences > AspectJ > Compiler (Windows/Linux), or Eclipse > Preferences > AspectJ > Compiler (Mac). Select the Advanced tab, then check No inline and click OK to apply.

+

−

===How does the Visualiser work?===

+

Informal requests can be posted to the newsgroup or mailing list. Formal requests can be made by raising an AJDT enhancement request on Bugzilla.

−

The Visualiser is an extensible Eclipse plug-in that can be used to visualize anything that lends itself to a 'bars and stripes' style representation. In AJDT the Visualiser is used to show how aspects affect a project. See the Visualiser web page for more information.

+

−

===Why do I sometimes see errors in the editor but not in the problems view?===

+

== Using AJDT ==

−

By default the AspectJ editor is used for files with the .aj extension and the Java editor for files with the .java extension. Some experienced AspectJ users may wish to use AspectJ function in .java files such as referring to ITD methods or fields, using inner aspects, implementing interfaces defined in aspects or calling methods on aspects. In this case you will see errors in the Java editor (although there will not be errors in the problems view). You may wish to either convert the file extension to .aj or use the AspectJ editor.

+

−

To open a .java file with the AspectJ editor right click, then select Open With > AspectJ/Java Editor. To use the AspectJ editor for all .java files select Window > Preferences > General > File Associations (Windows/Linux), or Eclipse > Preferences > General > File Associations (Mac). Select .java in the right-hand window, then use the section below to change the default editor.

+

=== What version of AJDT do I need? ===

−

===What are the limitations of the AspectJ Editor?===

+

The recommended version of AJDT depends on the version of Eclipse that you are using. Eclipse 3.4 requires AJDT 1.6, Eclipse 3.3 requires AJDT 1.5, and Eclipse 3.2 requires AJDT 1.4 (etc.). Typically, the latest development version is just as stable as our official releases (we never release anything unless anything unless it passes all tests). You can find the latest development release as well as all of the official AJDT release from the AJDT downloads page.

−

Although similar, using the AspectJ editor is not exactly the same as using a Java editor. Besides an AspectJ editor providing AspectJ-related capabilities, there is some functionality that it does not provide, but the Java editor does. For example, override/implement gutter markers are not shown.

+

−

If there is some functionality that is missing from AspectJ editors that is present in Java editors, please mention it on the mailing list or raise a bug for it.

+

=== Why aren't AspectJ keywords highlighted in the editor? ===

−

===What happens if I write my aspects in .java files?===

+

The most common cause of this problem is having AspectJ constructs in Java files (files with the .java extension) and using the JDT's Java Editor. Aspects and AspectJ constructs should be contained in .aj files which are opened with the AspectJ Editor, an extension to the Java Editor.

−

AJDT does not support aspects written in .java files. Although the compiler will compile them correctly, you will find some loss of functionality in AJDT if you do use .java files for your aspects:

+

−

+ The Outline and Package Explorer views will not show aspects or their contents.

+

=== How can I debug AspectJ programs in Eclipse? ===

−

+ The Cross References view will not show any information for an aspect in a .java file, although it will show information for any classes advised by that aspect.

+

−

===How do I use Ant to build my AspectJ projects in AJDT?===

+

AspectJ programs can be run in the debugger in the same way as Java programs. The tools enable the user to step into, through and out of advice. The AspectJ development tools also provide the facility to set breakpoints in aspects.

−

Since AJDT 2.1.0 for Eclipse 3.6, see this [http://contraptionsforprogramming.blogspot.com/2010/03/ajdt-pde-builds-redux.html blog post].

+

=== Why don't breakpoints in around advice work? ===

+

Around advice is inlined by the weaver by default, which means that breakpoints set in the declaring aspect are not detected. To disable inlining select Window &gt; Preferences &gt; AspectJ &gt; Compiler (Windows/Linux), or Eclipse &gt; Preferences &gt; AspectJ &gt; Compiler (Mac). Select the Advanced tab, then check No inline and click OK to apply.

−

On earlier versions of AJDT, to use Ant to build an AspectJ project you need to use the iajc Ant task instead of the javac task. The definition of this is found in ajde.jar in the org.aspectj.ajde plug-in. In addition you will need some other plug-ins on the classpath. A simple example written for Eclipse 3.2.1 is shown below. Note that paths and version numbers will be different on different machines and different Eclipse versions. Using Ant independently from Eclipse will be slightly different - see the AspectJ development guide for more details and for more information about the iajc Ant task.

+

=== How does the Visualiser work? ===

−

<?xml version="1.0" encoding="UTF-8"?>

+

The Visualiser is an extensible Eclipse plug-in that can be used to visualize anything that lends itself to a 'bars and stripes' style representation. In AJDT the Visualiser is used to show how aspects affect a project. See the Visualiser web page for more information.

=== Why do I sometimes see errors in the editor but not in the problems view? ===

−

Upgrading the AspectJ version in an install of AJDT is not generally recommended because it is likely that different releases will not be compatible with each other. However we do plan to provide some scripts in the near future that will upgrade your AspectJ to a higher compatible version if available.

+

−

==Extending==

+

By default the AspectJ editor is used for files with the .aj extension and the Java editor for files with the .java extension. Some experienced AspectJ users may wish to use AspectJ function in .java files such as referring to ITD methods or fields, using inner aspects, implementing interfaces defined in aspects or calling methods on aspects. In this case you will see errors in the Java editor (although there will not be errors in the problems view). You may wish to either convert the file extension to .aj or use the AspectJ editor.

−

===How can I build tools which extend AJDT?===

+

To open a .java file with the AspectJ editor right click, then select Open With &gt; AspectJ/Java Editor. To use the AspectJ editor for all .java files select Window &gt; Preferences &gt; General &gt; File Associations (Windows/Linux), or Eclipse &gt; Preferences &gt; General &gt; File Associations (Mac). Select .java in the right-hand window, then use the section below to change the default editor.

−

See [[Developer's guide to building tools on top of AJDT and AspectJ]].

+

−

==Contributing==

+

=== What are the limitations of the AspectJ Editor? ===

−

===How can I contribute to the AJDT project?===

+

Although similar, using the AspectJ editor is not exactly the same as using a Java editor. Besides an AspectJ editor providing AspectJ-related capabilities, there is some functionality that it does not provide, but the Java editor does. For example, override/implement gutter markers are not shown.

−

See the Developer FAQ

+

−

===Where will I find the source for AJDT?===

+

If there is some functionality that is missing from AspectJ editors that is present in Java editors, please mention it on the mailing list or raise a bug for it.

−

See the Developer FAQ

+

−

===How do I setup an AJDT development environment in Eclipse?===

+

=== What happens if I write my aspects in .java files? ===

−

See the Developer FAQ

+

−

===How can I package my sample code for contribution to the examples plug-in?===

+

AJDT does not support aspects written in .java files. Although the compiler will compile them correctly, you will find some loss of functionality in AJDT if you do use .java files for your aspects:

−

See the Developer FAQ

+

−

==Plans==

+

+ The Outline and Package Explorer views will not show aspects or their contents. + The Cross References view will not show any information for an aspect in a .java file, although it will show information for any classes advised by that aspect.

−

===Where do I find out about future releases of AJDT?===

+

=== How do I use Ant to build my AspectJ projects in AJDT? ===

−

See the plans page for information about future releases.

+

−

===What new AJDT features are being worked on at the moment?===

+

Since AJDT 2.1.0 for Eclipse 3.6, see this [http://contraptionsforprogramming.blogspot.com/2010/03/ajdt-pde-builds-redux.html blog post].

−

Look for open AJDT bugs in bugzilla or ask a question to the mailing list. We are a friendly bunch and are happy to answer your questions.

+

+

<br> On earlier versions of AJDT, to use Ant to build an AspectJ project you need to use the iajc Ant task instead of the javac task. The definition of this is found in ajde.jar in the org.aspectj.ajde plug-in. In addition you will need some other plug-ins on the classpath. A simple example written for Eclipse 3.2.1 is shown below. Note that paths and version numbers will be different on different machines and different Eclipse versions. Using Ant independently from Eclipse will be slightly different - see the AspectJ development guide for more details and for more information about the iajc Ant task.

Upgrading the AspectJ version in an install of AJDT is not generally recommended because it is likely that different releases will not be compatible with each other. However we do plan to provide some scripts in the near future that will upgrade your AspectJ to a higher compatible version if available.

+

+

== Extending ==

+

+

=== How can I build tools which extend AJDT? ===

+

+

See [[Developer's guide to building tools on top of AJDT and AspectJ]].

+

+

== Contributing ==

+

+

=== How can I contribute to the AJDT project? ===

+

+

See the [[AJDT Developer FAQ]].

+

+

=== Where will I find the source for AJDT? ===

+

+

See the [[AJDT Developer FAQ]].

+

+

=== How do I setup an AJDT development environment in Eclipse? ===

+

+

See the [[AJDT Developer FAQ]].

+

+

=== How can I package my sample code for contribution to the examples plug-in? ===

+

+

See the [[AJDT Developer FAQ]].

+

+

== Plans ==

+

+

=== Where do I find out about future releases of AJDT? ===

+

+

See the plans page for information about future releases.

+

+

=== What new AJDT features are being worked on at the moment? ===

+

+

Look for open AJDT bugs in bugzilla or ask a question to the mailing list. We are a friendly bunch and are happy to answer your questions.

Overview

What is AJDT? The AspectJ Development Tools project (AJDT) is a set of plug-ins for Eclipse that provide support for aspect-oriented software development using AspectJ within the Eclipse IDE.

Who develops AJDT?

AJDT is an open-source project hosted on eclipse.org, current contributors are listed on the website. Anyone can get involved, see How can I contribute to the AJDT project?

How does AJDT relate to the AspectJ project?

AJDT provides Eclipse IDE integration for AspectJ, and includes the AJDE (AspectJ Development Environment) libraries from the AspectJ project as part of its packaging. Development of the AspectJ compiler and AJDE takes place under the AspectJ project.

Community

Is there an AJDT mailing list?

AJDT has a developers mailing list, ajdt-dev@dev.eclipse.org, with archives and subscription information available online. Questions regarding the use of AspectJ the language are best directed to the AspectJ users mailing list.

Are there any newsgroups for AJDT users?

AJDT is supported through the eclipse.technology.ajdt newsgroup. A web interface is also available.

What do I do if I think I've found a bug in AJDT?

First check the bug database to see if you've hit a known problem. If it appears to be a genuinely new bug, please submit a bug report on AJDT using bugzilla following the bug reporting guidelines.

Extra useful information to include in an AJDT bug report:

Information from the AJDT Event Trace view. This view displays a lot of diagnositc information about the execution of the plug-in, for example, it will show you the exact classpaths being used for compilation, the time spent in the compiler. To open the AJDT Event Trace go to Window > Show view > Other... > AspectJ > AJDT Event Trace.

How can I request a new feature in AJDT?

Informal requests can be posted to the newsgroup or mailing list. Formal requests can be made by raising an AJDT enhancement request on Bugzilla.

Using AJDT

What version of AJDT do I need?

The recommended version of AJDT depends on the version of Eclipse that you are using. Eclipse 3.4 requires AJDT 1.6, Eclipse 3.3 requires AJDT 1.5, and Eclipse 3.2 requires AJDT 1.4 (etc.). Typically, the latest development version is just as stable as our official releases (we never release anything unless anything unless it passes all tests). You can find the latest development release as well as all of the official AJDT release from the AJDT downloads page.

Why aren't AspectJ keywords highlighted in the editor?

The most common cause of this problem is having AspectJ constructs in Java files (files with the .java extension) and using the JDT's Java Editor. Aspects and AspectJ constructs should be contained in .aj files which are opened with the AspectJ Editor, an extension to the Java Editor.

How can I debug AspectJ programs in Eclipse?

AspectJ programs can be run in the debugger in the same way as Java programs. The tools enable the user to step into, through and out of advice. The AspectJ development tools also provide the facility to set breakpoints in aspects.

Why don't breakpoints in around advice work?

Around advice is inlined by the weaver by default, which means that breakpoints set in the declaring aspect are not detected. To disable inlining select Window > Preferences > AspectJ > Compiler (Windows/Linux), or Eclipse > Preferences > AspectJ > Compiler (Mac). Select the Advanced tab, then check No inline and click OK to apply.

How does the Visualiser work?

The Visualiser is an extensible Eclipse plug-in that can be used to visualize anything that lends itself to a 'bars and stripes' style representation. In AJDT the Visualiser is used to show how aspects affect a project. See the Visualiser web page for more information.

Why do I sometimes see errors in the editor but not in the problems view?

By default the AspectJ editor is used for files with the .aj extension and the Java editor for files with the .java extension. Some experienced AspectJ users may wish to use AspectJ function in .java files such as referring to ITD methods or fields, using inner aspects, implementing interfaces defined in aspects or calling methods on aspects. In this case you will see errors in the Java editor (although there will not be errors in the problems view). You may wish to either convert the file extension to .aj or use the AspectJ editor.

To open a .java file with the AspectJ editor right click, then select Open With > AspectJ/Java Editor. To use the AspectJ editor for all .java files select Window > Preferences > General > File Associations (Windows/Linux), or Eclipse > Preferences > General > File Associations (Mac). Select .java in the right-hand window, then use the section below to change the default editor.

What are the limitations of the AspectJ Editor?

Although similar, using the AspectJ editor is not exactly the same as using a Java editor. Besides an AspectJ editor providing AspectJ-related capabilities, there is some functionality that it does not provide, but the Java editor does. For example, override/implement gutter markers are not shown.

If there is some functionality that is missing from AspectJ editors that is present in Java editors, please mention it on the mailing list or raise a bug for it.

What happens if I write my aspects in .java files?

AJDT does not support aspects written in .java files. Although the compiler will compile them correctly, you will find some loss of functionality in AJDT if you do use .java files for your aspects:

+ The Outline and Package Explorer views will not show aspects or their contents. + The Cross References view will not show any information for an aspect in a .java file, although it will show information for any classes advised by that aspect.

How do I use Ant to build my AspectJ projects in AJDT?

On earlier versions of AJDT, to use Ant to build an AspectJ project you need to use the iajc Ant task instead of the javac task. The definition of this is found in ajde.jar in the org.aspectj.ajde plug-in. In addition you will need some other plug-ins on the classpath. A simple example written for Eclipse 3.2.1 is shown below. Note that paths and version numbers will be different on different machines and different Eclipse versions. Using Ant independently from Eclipse will be slightly different - see the AspectJ development guide for more details and for more information about the iajc Ant task.

Can I upgrade my AspectJ version?

Upgrading the AspectJ version in an install of AJDT is not generally recommended because it is likely that different releases will not be compatible with each other. However we do plan to provide some scripts in the near future that will upgrade your AspectJ to a higher compatible version if available.