[org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher 问题--MyEclipse设置JDK版本

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版本

原文地址:https://www.cnblogs.com/babysbreath/p/9561682.html