http://bbs.csdn.net/topics/390838736
----这个文件在org.springframework.core包下
org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser自動檢測,jdk版本檢測時需要jre1.5以上版本,但是JdkVersion只檢查到了1.7,jre1.8 時不匹配任何jdk, 修正如下,問題解决
public abstract class JdkVersion {
public static final int JAVA_13 = 0;
public static final int JAVA_14 = 1;
public static final int JAVA_15 = 2;
public static final int JAVA_16 = 3;
public static final int JAVA_17 = 4;
//for jre 1.8
public static final int JAVA_18 = 5;
private static final String javaVersion = System
.getProperty("java.version");
private static final int majorJavaVersion;
public static String getJavaVersion() {
return javaVersion;
}
public static int getMajorJavaVersion() {
return majorJavaVersion;
}
public static boolean isAtLeastJava14() {
return true;
}
public static boolean isAtLeastJava15() {
return getMajorJavaVersion() >= 2;
}
public static boolean isAtLeastJava16() {
return getMajorJavaVersion() >= 3;
}
static {
//for jre 1.8
if (javaVersion.indexOf("1.8.") != -1) {
majorJavaVersion = 5;
}else if (javaVersion.indexOf("1.7.") != -1) {
majorJavaVersion = 4;
} else if (javaVersion.indexOf("1.6.") != -1) {
majorJavaVersion = 3;
} else if (javaVersion.indexOf("1.5.") != -1) {
majorJavaVersion = 2;
} else {
majorJavaVersion = 1;
}
}
}
分享到:
相关推荐
org.springframework.web.bind.annotation.SessionAttributes.class org.springframework.web.bind.support.ConfigurableWebBindingInitializer.class org.springframework.web.bind.support....
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.class org.springframework.test.annotation.DirtiesContext.class org.springframework.test.annotation.ExpectedException.class...
spring mvc 开发的必须有的架包org.springframework.web.servlet-3.0.5.RELEASE.jar
org.springframework.web.servlet-3.0.0.M4.jar
The import org.springframework.web.bind.annotation cannot be resolved. json.jar spring.jar mail.jar log4j.jar
org.springframework.beans.annotation org.springframework.beans.factory org.springframework.beans.factory.access org.springframework.beans.factory.access.el org.springframework.beans.factory.annotation...
org.springframework.osgi.extensions.annotation-1.2.1.jar
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication public class MainApplication { public static ...
import org.springframework.context.annotation.Bean; import org.springframework.web.filter.HiddenHttpMethodFilter; @SpringBootApplication public class WmsApplication { public static void main(String...
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop=...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...
org.springframework.core.annotation.AnnotationAttributes org.springframework.core.annotation.AnnotatedElementUtils org.springframework.core.annotation.AnnotationUtils org.springframework.core....
import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan(basePackages = {"com.example.*"}) //指定扫描包路径 public class DemoApplication { public static void ...
java错误-java.lang.ClassNotFoundException: org.aspectj.lang.annotation.Around Spring的AOP需要上述三个jar包
nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: ...
上手 <!-- maven导入 --> ...import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.ann
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet; import org....
defining beans [userController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.spring...
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) at org.springframework.web.servlet.mvc.method....