Java 8 Spring 兼容性 [英] Java 8 Spring compatibility
问题描述
我目前正在将我的应用程序从 Java 7 迁移到 Java 8,目前我正在运行 Spring 3.1.6 jar.这会与 Java 8 兼容还是我需要升级 Spring jar ?
I am currently migrating my application from Java 7 to Java 8 and currently I am running the Spring 3.1.6 jar. Would this be compatible with Java 8 or I need to upgrade the Spring jar ?
我知道 Spring 4x 版本自然支持 Java 8,但这是时间紧迫的,我正在寻求尽可能少地更改 jar.
I understand that the Spring 4x version has natural support for Java 8, but this is time critical and I am seeking to change as little jars as I can.
推荐答案
基本上 Spring 3.x
版本最多只支持 Java-7
.如果你想迁移到 Java-8
,你应该使用 Spring 4.x
版本.
Basically Spring 3.x
versions supports up to Java-7
only. If you want to migrate to Java-8
you should use Spring 4.x
version.
但是一些 spring 发行说明说 Spring Framework 3.2.x
将支持在 JDK 8
运行时上部署编译的应用程序针对 JDK 7
(使用 -target 1.7)或更早版本.请注意,它不会支持 JDK 8
的字节码格式(-target 1.8,根据 lambdas 的需要);为此,请升级到 Spring Framework 4.0
.
However some spring release notes says that the
Spring Framework 3.2.x
will support deployment onJDK 8
runtimes for applications compiled againstJDK 7
(with -target 1.7) or earlier. Note that it won’t supportJDK 8
’s bytecode format (-target 1.8, as needed for lambdas); please upgrade toSpring Framework 4.0
for that purpose.
关注这个链接到源文章.
这篇关于Java 8 Spring 兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!