A simplified version of this problem is below:
Here, there are two projects, an AspectJ project and a Java project. The AspectJ project has an aspect that declares an ITD on a Java class. This Java class and its ITD is then referenced in the Java project. Even though the Java project compiles and runs correctly, an error appears in the editor.
Thankfully, there is a simple fix to this. Open up the .project file for the Java project and add the following line to the nnatures element:
<nature>org.eclipse.ajdt.ui.ajnature</nature>
(Note: this line should be the first nature if you want the AJ decorator to appear on the project icon.)
What this does is tell AJDT that this project should be treated like an AspectJ project, but it does not change the compiler, so the Java compiler is still used. The result is that ITDs are now correctly recognized in the editor:
In the future, I'll probably add a quick fix or some other automated way of doing this in future releases of AJDT, but for now this manual process is a reasonable workaround.
hello, thanks for nice tip.
ReplyDeleteİs it still an issue for new ajdt and eclipse?
thanks
I haven't done any specific work in this area recently. Are you have a problem with something?
ReplyDelete