为什么我会在 Java 8 中收到与 JDK 1.5 相关的错误消息?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32554635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 12:45:41  来源:igfitidea点击:

Why am I getting a JDK 1.5 related error message in Java 8?

javaspring

提问by Alex R

Exception message

异常信息

Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

上下文命名空间元素“component-scan”及其解析器类 [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] 仅在 JDK 1.5 及更高版本上可用

Java -version

Java 版本

java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

采纳答案by Nir Levy

your issue is not with the java version, but with your spring version. take a look here. Upgrade to newer spring version

您的问题不在于 java 版本,而在于您的 spring 版本。看看这里。升级到较新的 spring 版本