Skip to content

JDK 8 support for Spring 2.5.x [SPR-11899] #16518

Closed

Description

@spring-projects-issues

Jocelyn N'TAKPE opened SPR-11899 and commented

I know Spring 2.X is no longer supported but is it possible to release a new version supporting JDK 1.8.

static {
     javaVersion = System.getProperty("java.version");
     // version String should look like "1.4.2_10"
     if (javaVersion.indexOf("1.7.") != -1) {
          majorJavaVersion = JAVA_17;
     }
     else if (javaVersion.indexOf("1.6.") != -1) {
          majorJavaVersion = JAVA_16;
     }
     else if (javaVersion.indexOf("1.5.") != -1) {
          majorJavaVersion = JAVA_15;
     }
     else {
          // else leave 1.4 as default (it's either 1.4 or unknown)
          majorJavaVersion = JAVA_14;
     }
}

No further details from SPR-11899

Activity

  1. spring-projects-issues commented on Jun 23, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    I'm afraid this is far outside the support range. Spring Framework 2.5.6 got released in 2008, and it just about covers JDK 6 and - de facto - basic JDK 7 compatibility (even if JDK 7 got released as late as 2011). However, 2014's JDK 8 is six years apart - that's just not feasible anymore.

    Please upgrade to at least Spring Framework 3.2.9 which does have basic JDK 8 support - and it contains pretty much all of 2.5.6's support classes still: some of them in deprecated form but still working, thus providing a straightforward upgrade path for 2.5.6 users. Have you tried it?

    Note that our full JDK 8 story (including JSR-310 support, repeatable annotations, parameter name discovery) is only available in the Spring Framework 4.x line... 3.2.9 just provides basic compatibility with the JDK 8 bytecode level plus a few further runtime compatibility tweaks.

    Juergen

  2. spring-projects-issues commented on Jun 23, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Jocelyn Ntakpe commented

    Thanks for your answer.
    Our new applications will be developped with spring 4 or spring 4.1. Still we wanted to upgrade old ones to Jdk8 without migrating spring too.

  3. spring-projects-issues commented on Jun 23, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    Any specific reason why upgrading your older apps to Spring Framework 3.2.9 wouldn't work? Did you try a smoke test, simply bumping up the build dependency from 2.5.6 to 3.2.9?

    FYI, we're doing a 3.2.9 service release in July. Let me know whether there's anything we can do for you there. There'll be a further 3.2.9 service release later this year, if needed.

    Juergen

  4. spring-projects-issues commented on Jun 23, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Jocelyn Ntakpe commented

    Thanks for the advice. Indeed will try 3.2.9 migration.

  5. spring-projects-issues commented on Jun 8, 2017

    @spring-projects-issues
    CollaboratorAuthor

    C D commented

    You could also just overwrite this class.
    That is what I did on two projects that are still using Spring 2.X.
    After downloading the source add the following:
    public static final int JAVA_18 = 5;
    ...
    static{
    javaVersion = System.getProperty("java.version");
    // version String should look like "1.4.2_10"
    if(javaVersion.contains("1.8.")){
    majorJavaVersion = JAVA_18;
    // System.out.println("JAVA_VERSION: " + javaVersion);
    }else if(javaVersion.indexOf("1.7.") != -1){
    majorJavaVersion = JAVA_17;
    }else if(javaVersion.indexOf("1.6.") != -1){
    majorJavaVersion = JAVA_16;
    }else if(javaVersion.indexOf("1.5.") != -1){
    majorJavaVersion = JAVA_15;
    }else{
    // else leave 1.4 as default (it's either 1.4 or unknown)
    majorJavaVersion = JAVA_14;
    }
    }

  6. added
    status: declined
    type: enhancement
    in: core
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corestatus: declinedtype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions