-2

I have read following questions related to Spring 3.2 and Java 8 compatibility issues but i still have few open questions.

Java 8 Spring compatibility

spring-core 3.2.9 + java 8

Spring 3.2.x with Java 8

Let's say there is an artifact (e.g. DAL) that uses Spring 3.2 and this artifact has to be shared between java 7 service (Service A) and java 8 service ( Service B). These services will compiled and run against respective Java/JVMs.

Now question is - will it be possible to use DAL in both Service-A and Service-B?

As per snippet 1, it should work because Java 8 runtime supports the Spring 3.2 libraries compiled against Java 7 but as per snippet 2 this shouldn't work as Service-B has been complied against java 8 and it is going to use DAL that has been compiled against java 7.

Snippet 1:

However some spring release notes says that the Spring Framework 3.2.x will support deployment on JDK 8 runtimes for applications compiled against JDK 7 (with -target 1.7) or earlier. Note that it won’t support JDK 8’s bytecode format (-target 1.8, as needed for lambdas); please upgrade to Spring Framework 4.0 for that purpose.

Snippet 2:

Versions of the Spring Framework that are older than 4.0M1 do not work with classes that are compiled for Java 8.

Atul
  • 1,694
  • 4
  • 21
  • 30
  • It will be good if you can provide reasons for down-voting. Thanks. – Atul Dec 08 '17 at 04:12
  • _"Please also share your valuable experiences for Java 7 to Java 8 migrations with Spring 3.X."_ -- this is a request for discussion, not a specific, answerable question. Please visit the [help] and read [ask] to lrean how to use this site effectively. – Jim Garrison Dec 08 '17 at 04:57
  • @JimGarrison Removed the line. Thanks for highlighting. – Atul Dec 12 '17 at 02:47

1 Answers1

0

There is no point of migrating to Java 8 with Spring 3.x, Its better to move to JDK 1.8 and Spring 4.x. The JDK 8 migration should not be an issue unless the code has to be changed for JDK 8 features.

Spring 3.2.9 will be the best bet in terms of Java 8 byte code support.

Joe
  • 47
  • 1
  • 10