`

项目迁移(org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser

 
阅读更多
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;
        }
    }
}
分享到:
评论

相关推荐

    spring-web-2.5.jar

    org.springframework.web.bind.annotation.SessionAttributes.class org.springframework.web.bind.support.ConfigurableWebBindingInitializer.class org.springframework.web.bind.support....

    spring-mock.jar

    org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.class org.springframework.test.annotation.DirtiesContext.class org.springframework.test.annotation.ExpectedException.class...

    org.springframework.web.servlet-3.0.5.RELEASE.jar

    spring mvc 开发的必须有的架包org.springframework.web.servlet-3.0.5.RELEASE.jar

    org.springframework.web.servlet-3.0.0.M4.jar

    org.springframework.web.servlet-3.0.0.M4.jar

    spring开发中的jar包,json,annotation

    The import org.springframework.web.bind.annotation cannot be resolved. json.jar spring.jar mail.jar log4j.jar

    asm-3.2.3.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

    org.springframework.osgi.extensions.annotation-1.2.1.jar

    SpringBootTestApplication

    import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication public class MainApplication { public static ...

    No1WMS-master WMS JAVA

    import org.springframework.context.annotation.Bean; import org.springframework.web.filter.HiddenHttpMethodFilter; @SpringBootApplication public class WmsApplication { public static void main(String...

    springmvc-ibatis

    <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=...

    Spring In Action-2.1-01-@Component注解

    import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...

    spring4.0 API

    org.springframework.core.annotation.AnnotationAttributes org.springframework.core.annotation.AnnotatedElementUtils org.springframework.core.annotation.AnnotationUtils org.springframework.core....

    springboot 基础简易实例, maven项目

    import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan(basePackages = {"com.example.*"}) //指定扫描包路径 public class DemoApplication { public static void ...

    org.aspectj.lang.annotation.Around所需要的包

    java错误-java.lang.ClassNotFoundException: org.aspectj.lang.annotation.Around Spring的AOP需要上述三个jar包

    springAOP demo 带错误解决文档

    nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: ...

    基于springboot行为滑块验证码tianai-captcha的快速启动器.zip

    上手 <!-- maven导入 --> ...import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.ann

    spring jdbctemplate 封裝

    import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet; import org....

    Javaweb项目

    defining beans [userController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.spring...

    apache-tomcat-7.0.69.zip

    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) at org.springframework.web.servlet.mvc.method....

Global site tag (gtag.js) - Google Analytics