Hi,
I am studying the load-time weaving.
If I use “-javaagent=aspectjweaver.jar”, I
got “Unrecognized option: -javaagent=aspectjweaver.jar”.
If I use “-javaagent:aspectjweaver.jar” in
the following command line:
D:\workdir>D:\workdir\platform\jdk1.5.0\bin\java
-cp aspectjsamplesw.jar;aspectjsamples.jar;aspectjweaver.jar;aspectjrt.jar
-javaagent:aspectjweaver.jar helloworld.Hello
Exception in thread "main"
java.lang.ClassNotFoundException: aspectjweaver.jar
at
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at
java.security.AccessController.doPrivileged(Native Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:290)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:279)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:236)
at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:165)
FATAL ERROR in native method: processing of -javaagent
failed
Can anyone kindly help me what’s wrong with the
above line?
aspectjsamplesw.jar contains the aspects, and
aspectjsamples.jar is a java application that want to be woven by aspectjsamplesw.jar.
Thanks
Guofeng