Christian Rockrohr
Christian Rockrohr

Reputation: 1045

Which is the minimum supported Java Version of Spring 4

I recently one of my projects to Spring 4.0.0.RELEASE

After deploying the project to my staging environment, I recognized an Exception with the following Message: bad major version at offset=6. My assumption is, that Sping 4 is not working with Java 6 (which I am forced to, because I can not change it on the system)

(Actually I even was not aware, that a JAR is depending on the Java Version)

Upvotes: 7

Views: 28303

Answers (3)

user3434043
user3434043

Reputation: 11

jdk 1.6 update-18 or above(latest in 1.6 jdk is jdk-6u-45) versions will support spring 4.0

Upvotes: 1

MariuszS
MariuszS

Reputation: 31585

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

This is wrong assumption.

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.

Read also:

This look like running a Spring 4 application with JDK 1.5.

Confirmed:

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

Upvotes: 13

Ralph
Ralph

Reputation: 120851

An exception like this

java.lang.UnsupportedClassVersionError: bad major version at offset=6

Will occure when code is compiled for java version 6, but one try to run it with java 5.

Upvotes: 0

Related Questions