java - 哪个是 Spring 4 支持的最低 Java 版本

标签 java spring

我最近将我的一个项目发布到 Spring 4.0.0.RELEASE

将项目部署到暂存环境后,我发现了一个异常并显示以下消息:偏移量 = 6 处的主要版本错误。我的假设是,Sping 4 不能与 Java 6 一起工作(我被迫这样做,因为我无法在系统上更改它)

(其实我都不知道,一个JAR是依赖Java版本的)

最佳答案

Christian Rockrohr My assumption is, that Sping 4 is not working with Java 6

这是错误的假设。

Spring requires JVM 1.6 or higher, as of Spring 4.0. *****

Java 8 (as well as 6 and 7)

Spring remains compatible with older versions of Java and the JDK: Concretely, Java SE 6 (specifically, a minimum level equivalent to JDK 6 update 10, as released in late 2008) and above are still fully supported. However, for newly started development projects based on Spring 4, we recommend the use of Java 7 or 8.

另请阅读:

这看起来像是使用 JDK 1.5 运行 Spring 4 应用程序。

确认:

Christian Rockrohr: Indeet, there is Java 1.5 installed on my AS400, it is not Java 1.6. That's is the reason, why Spring did not work. I just returned to Spring 3.1.0.RELEASE and it worked.

*****) http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/JdkVersion.html

关于java - 哪个是 Spring 4 支持的最低 Java 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21120437/

相关文章:

java - 如何使用 Rest 模板将 TLS1.2 强制执行到 Rest 客户端

java - Gradle Artifactory 插件 - 如何自动部署 Spring Boot Fatjar

java - Spring Boot 项目命名约定

java - 从 QueryChangeDescription 获取 RowId

java - Android 应用程序和 Java 程序使用通用的 HTTP 相关代码

java - 如何使用 FTP 在 Java 中的一次调用中创建具有多个级别的目录

Java:在 for 循环中使用 .charAt() 时出现 StringIndexOutOfBoundsException

java - Spring session 登录

java - 多个事务管理器 NoUniqueBeanDefinitionException

java - 为什么我们使用 finally block ?