Community
Participate
Working Groups
Sample Hello.java File public class Hello{ public static void main (String []args) { say ("Hello World"); } public static void say (String arg) { System.out.println (arg); } } sample Manners.java public aspect Manners { pointcut callsay ():call (* Hello.say (..)); before (): callsay () { System.out.println ("Welecome"); } after (): callsay () { System.out.println ("Good bye"); } } //// I am using AspectJ1.1 and jdk1.3.1, when i compile them with ajc Hello.java Manners.java, it successfully create respected class files. but when i execute java Hello.java. I prompts me following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/NoAspectBoundException at Hello.main(Hello.java:6) Also I tried the same steps with AspectJ1.5 and it also prompts me said Error.
When running code built with AspectJ you must ensure the aspectjrt.jar is on your classpath. It can be found in your <aspectjInstallDir>/lib folder. This jar contains the NoAspectBoundException class.
*** Bug 92500 has been marked as a duplicate of this bug. ***
Is this resolved now? Did you fix it by putting aspectjrt.jar on your classpath when executing the program?
I'm assuming the recommended solution fixed the problem. if not, please reopen.