学习Spring5注解的时候,使用的JDK版本为17,Spring版本为5.2.5RELEASE。普通的注入属性操作等均没问题,但在使用注解的时候,报错:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class:
nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 61
JDK与Spring版本的问题。然后试着将JDK换位最新的1.8版本,操作如下:
然后再maven的配置文件中更新
1.8 1.8
最后Reload maven :
再使用注解,成功编译。



