Hi *,
at my company, we are currently working with Eclipse for our Java projects.
As me and some other coworkers would rather use IntelliJ, we took a crack at migrating our projects and failed at getting AspectJ to work.
Here are the steps we took:
- import the project and dependencies into IntelliJ
- download and install AspectJ
- Under Settings -> Java Compiler: Use ajc compiler, delegate to javac (path to aspectjtools.jar is correct as the test button indicates)
- Add AspectJ libs to Global Libraries (aspectjrt.jar, aspectjtools.jar, aspectjweaver.jar, and org.aspectj.matcher.jar)
- Create AspectJ facet for the one module that is using AspectJ, leave all settings as is (no aspect path defined)
- Add aspectjrt to project libraries
- rebuild, make etc.
On make I get the following errors:
Error:(38, 0) ajc: The type LoggingDirectory must implement the inherited abstract method LogContext.isDebugEnabled()
LogContext is just an empty interface. Classes that want a logger appended implement this interface.
This method is injected with AspectJ. Unfortunately I am not an expert with this and guy who implemented it already left, so I am stuck.
In order to check general functionality, we implemented a tiny project from scratch with just three classes with the same settings as above:
publicinterface LogContext {}
public aspect LogContextAspect { publicvoid LogContext.log() { System.out.println("Log!"); } }
publicclass Aspect implements LogContext { publicstaticvoid main(String[] args) { Aspect aspect = new Aspect(); aspect.log(); } }
The code actually executes fine and prints out the "Log!" message, but on make I get the following error:
Error:(4, 0) ajc: The type Aspect must implement the inherited abstract method LogContext.log()
What are we missing here? In order to migrate our projects, we need AspectJ to work.
The whole system is built with Java 6 compatibility but runs on Java 7.
Thanks for your help!
- Sascha