spring-core 3.2.9 + java 8

You need to upgrade to a Spring 4.x version.

Spring 3.2.x will only support Java 8 runtimes compiled against Java 7. You cannot use “static interfaces” as that is a Java 8 feature and will not compile against Java 7.

Here is a relevant snippet from some of the Spring 4 release notes, emphasis theirs:

Along with 4.0 M1, we’ve released Spring Framework 3.2.3, containing
fixes for recently reported issues but also coming with OpenJDK 8
runtime support. Spring Framework 3.2.x will support deployment on JDK
8 runtimes for applications compiled against JDK 7
(with -target 1.7)
or earlier.

And from their comments in the build.gradle file for spring-framework, they repackage CGLib as part of their release and embed ASM into the project.

// As of Spring 4.0.3, spring-core includes asm 5.0 and repackages cglib 3.1, inlining
// both into the spring-core jar. cglib 3.1 itself depends on asm 4+, and is therefore
// further transformed by the JarJar task to depend on org.springframework.asm; this
// avoids including two different copies of asm unnecessarily.

Here is another relevant section from the 4.0.3 release notes that shows how they embed some of these libraries and what is supported in Spring 4.0.3.

It’s my pleasure to announce that Spring Framework 4.0.3 is available.
This is the first release of the framework after Java 8’s launch last
week; it is built with OpenJDK 8 GA now and includes the latest ASM
5.0.1 (with bytecode support at the JDK 8 GA level as well, superseding the custom ASM 4.2 fork that we were previously using).

Leave a Comment