title: Spring 3.2 with Java 7 and Java 8
body: <p>I have read following questions related to Spring 3.2 and Java 8 compatibility issues but i still have few open questions.</p>
  
  <p><a href="https://stackoverflow.com/questions/32278878/java-8-spring-compatibility">Java 8 Spring compatibility</a></p>
  
  <p><a href="https://stackoverflow.com/questions/24657418/spring-core-3-2-9-java-8">spring-core 3.2.9 + java 8</a></p>
  
  <p><a href="https://stackoverflow.com/questions/30072135/spring-3-2-x-with-java-8">Spring 3.2.x with Java 8</a></p>
  
  <p>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.</p>
  
  <p>Now question is -  will it be possible to use DAL in both Service-A and Service-B?</p>
  
  <p>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.</p>
  
  <p>Snippet 1:</p>
  
  <blockquote>
    <p>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. </p>
  </blockquote>
  
  <p>Snippet 2:</p>
  
  <blockquote>
    <p>Versions of the Spring Framework that are older than 4.0M1 do not work with classes that are compiled for Java 8.</p>
  </blockquote>