org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [annotation.xml]; nested exception is java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher
出現這種問題是因為JDK版本不一致導致的;下面對MyEclipse的jdk的設置進行匯總,希望可以幫到大家
1、配置myeclipse默認的jdk環境;
1)window ---> preferences ---> java ---> Installed JRES
2)選擇要用的jdk,如果沒有要用的,點擊“Add”的添加
2、更改MyEclipse的編譯版本。以適合自己的JDK版本
3、修改Tomcat對應的JDK,選擇適合自己的版本
4、設置MyEclipse Project Facets,對應的JDK版本