Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between aspectjrt-1.7.1.jar and aspectjweaver-1.7.1.jar,they all have the org.aspectj.lang.annotation.Pointcut.class

Tags:

java

spring

jar

It really confused me recently.The problem is that my terminal printed java.lang.ClassNotFoundException:org.aspectj.lang.annotation.Pointcut. Then I searched which jar on the CLASSPATH has the class.But I found both aspectjrt-1.7.1.jar and aspectjweaver-1.7.1.jar have the class.I can't figure out the difference of the two jars. It's a project written by other team. Can anyone help me?

like image 333
chenchen liu Avatar asked Aug 11 '16 16:08

chenchen liu


1 Answers

It looks like aspectjweaver is superset of aspectjrt + few other classes required for load-time weaving (LTW) during class-loading. So mostly if we include aspectjweaver it also has all the classes from aspectjrt so we don't need to include aspectjrt.jar anymore.

Please refer to description of both libraries in maven repository. https://mvnrepository.com/artifact/org.aspectj/aspectjweaver https://mvnrepository.com/artifact/org.aspectj/aspectjrt

like image 52
Prakash Boda Avatar answered Sep 30 '22 14:09

Prakash Boda