简体   繁体   中英

Weaving Aspect into executable jar file

I am trying to log all the method calls in a game that comes as an executable jar files.

I am using the command from the command line:

ajc -injars tetris.jar Tracing.aj -outjar tetris.jar...

After compiling the error is:

Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature

I am also an Eclipse user.

Yoou need to add aspectjrt.jar to your CLASSPATH.

Since you said you are an Eclipse user: How to Add JARs to Project Build Paths in Eclipse (Java) describes this in great detail.

1) Class is not available in Java Classpath.

2) Any startup script is overriding Classpath environment variable.

As Tomasz Nurkiewicz said you have to add it to your ClassPath.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM