【发布时间】:2015-08-31 07:21:11
【问题描述】:
在.java中
System.out.println(System.getProperty("java.version"));
我明白了
1.8.0_45
但是当我把它打包成一个jar包并在另一个项目中使用它时它告诉我
Offending resource: class path resource [applicationContext.xml];
nested exception is
org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from class path resource
[applicationContextYQ.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
为什么?
在cmd中
C:\Users\idea>java -version
java 版本“1.8.0_45”
Java(TM) SE 运行时环境(内部版本 1.8.0_45-b15)
Java HotSpot(TM) 64 位服务器 VM(内部版本 25.45-b02,混合模式)
【问题讨论】:
-
如何打包编译?
-
你在 IDE 项目中检查过你的
jdk版本了吗? -
@SanKrish 1.7 对于这个项目
-
你确定吗?您使用哪个 IDE?检查编译器设置
-
不要将代码、xml 等添加为 cmets。用这些信息改进你的问题。还可以使用
mvn dependency:tree检查您的库。