It is easy to tell that you are a C++ guy. There is no such thing as javacc
(if you are not talking about the Java Parser Generator of the same name) but the Java Compiler is called javac
. ;-)
As Philipp Wendler already pointed out, Eclipse is not just an IDE, it is an organisation similar to Apache, and AspectJ has been adopted many years ago as one of its projects. This has also the advantage that AJDT (AspectJ Development Tools) for Eclipse IDE are sort of the best AspectJ support you can get for any IDE, sadly including my favourite IntelliJ IDEA which is superior to Eclipse IDE in almost all respects except its AspectJ support being rather mediocre.
So much for the minor topics. Now as for your main question, it is not really suited for Stack Overflow because it is rather a forum question, not about a concrete programming problem requiring a solution. Anyway, I love AspectJ and will answer briefly:
AspectJ has its own compiler ajc
which is basically an enhanced version of the Eclipse Java Compiler ejc
, i.e. it can be used to compile normal Java files as well as aspects in native AspectJ syntax or in @AspectJ style annotation-based syntax. No matter which way you weave your aspects, e.g.
build aspect + Java code with ajc
from scratch (compile-time weaving),
build only aspects with ajc
and Java code with javac
, ejc
or any other Java compiler, then
weave aspects into Java class files via ajc
(post-compile or binary weaving) or
weave aspects into Java class files at runtime during class-loading with a Java agent called the AspectJ Weaver (load-time weaving, LTW),
What AspectJ does is always pretty much the same: It modifies Java byte code by weaving aspect code into it. In case 1 you just get one set of class files directly from ajc
. Case 2.1 creates additional, new class files. Case 2.2 just creates new byte code in memory directly in the JVM.