AnnotationAwareAspectJAutoProxyCreator is only available on Java 1.5 and higher

一、问题描述及原因。
       在Spring2.5Aop例子中的时候会出现一个错误only available on JDK 1.5 and higher,大概意思就是需要JDK1.5甚至更高版本。但是我用的是JDK1.8是比1.5高啊但是为什么报错呢?通过查阅资料此链接:http://fanli7.net/a/JAVAbiancheng/Spring/20140321/481981.html。上面说看源码是org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser自动检测,jdk版本检测的时候需要jre1.5以上版本,但是JdkVersion只检查到了1.7,jre1.8 时不匹配任何jdk。
二、解决办法。
1、降低JDK版本降低到1.7

2、改Spring2.5中org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser的代码加入 public static final int JAVA_18 = 5;

三、总结。
       不管多好的框架都会有这样那样的bug存在,我们开发的时候还是最好选用比较新一点的稳定一点的版本去开发,这样可以避免一些不必要的麻烦。

猜你喜欢

转载自blog.csdn.net/xiaozaq/article/details/79090419