`

项目迁移(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....

    org.springframework.core.jar

    3. **元数据与注解处理**:`org.springframework.core.annotation`包实现了对Java注解的处理,包括注解的元数据解析、处理和应用,使得基于注解的编程成为可能。Spring框架大量使用注解简化配置,如@Component、@...

    spring-mock.jar

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

    org.springframework.core_3.1.1.RELEASE.jar

    6. `org.springframework.core.annotation`: 包含了对Java注解的处理,如`MergedAnnotations`接口,用于合并和检索注解信息,是Spring元数据解析的关键部分。 7. `org.springframework.core.type`: 提供了类型扫描...

    org.springframework.test-3.0.2.RELEASE.jar

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

    org.springframework.orm.hibernate3.LocalSessionFactoryBean

    ### 关于 "org.springframework.orm.hibernate3.LocalSessionFactoryBean" 未找到问题的知识点解析 #### 一、问题背景 在开发基于Spring与Hibernate整合的应用时,可能会遇到“`org.springframework.orm.hibernate...

    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

    org.springframework.dao.InvalidDataAccessApiUsageException

    ### 关于 `org.springframework.dao.InvalidDataAccessApiUsageException` 的深入解析 在Spring与Hibernate集成开发过程中,开发者可能会遇到各种各样的异常问题。其中一种较为常见的异常是 `org.springframework....

    org.springframework.transaction-3.0.0.M4.jar

    org.springframework.transaction-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

    spring_MVC源码

    14. <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> 15. 16. <!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 --> 17. <bean class="org....

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

    综上所述,要解决“java.lang.ClassNotFoundException: org.aspectj.lang.annotation.Around”错误,确保这三个jar包已经正确地添加到项目的类路径中,并且正确配置了Spring的AOP设置。通过这种方式,你可以充分利用...

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

    redis-lock-master.zip

    import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java....

    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; @...

Global site tag (gtag.js) - Google Analytics