A standard java project has no awareness of aspects. You have two options:
- use the context menu on the Java project to add the aspectj nature. This replaces the java builder for the project with the aspectj builder. You can then set (in the project properties) the aspect path and point it at your jar. Then when the project is built the aspects will be applied to the contents.
- Run the java code with load time weaving. This involves modifying the launch configuration to use -javaagent:<pathtoaspectj>/lib/aspectjweaver.jar and ensuring that the aspect jar was built with -outxml specified, so that the jar will contain an aop*.xml file that lists the aspect. When your application runs the aspectjweaver code will attach a weaver to the class loader loading your app. That weaver will search for aop xml files to find aspects and then load up any aspects it finds and apply them to any code the associated loader loads (i.e. your application). There might be a context menu RunAs shortcut for launching with load time weaving, I don't quite recall.
Andy