Spring Updated for Java 8
Java 8 was released on March 18, just a few weeks ago. Days later, Juergen Hoeller, Spring Framework project lead, published an article titled Java 8 in Enterprise Projects. In it, he noted how established Java EE application servers won't allow you to upgrade easily.
With Java EE servers, there is usually an upgrade showstopper in the form of a bundled JDK version. With WebSphere, even on WAS 8.5, the default JDK is still Java 6, with Java 7 as an opt-in choice. With WebLogic, recent releases are more strongly Java 7 based already. However, neither of those servers lets you freely choose the JDK generation to use.
As deeply integrated as an application server stack typically is with a specific JDK version, it's not advisable to simply run it against a different JDK installation. A current-generation application server is not likely to survive even a startup smoke test against JDK 8.
Hoeller goes on to write that those using Tomcat and Jetty have the edge for developers who want to adopt Java 8 rapidly.
Lean web application servers such as Tomcat and Jetty have a clear advantage here in that they are not dependent on the specifics of any JDK version. Tomcat 8 and Jetty 9 have been tested against OpenJDK 8 for half a year already and are generally declared compatible with Java 8. Even Tomcat 7 joins that club, receiving an upgraded Eclipse compiler etc as well.
So both Tomcat and Jetty present themselves as immediate production-quality options for use with JDK 8.
He wraps up the post with a warning about specific frameworks and libraries needing to be Java 8 compatible. If you read the end of the article, it seems as if Spring is "ready to go" when it comes to Java 8.
The Spring Framework 4 generation has been designed in a Java 8 compatible fashion right from the start. In fact, we released Spring Framework 4.0 GA with comprehensive Java 8 development support even before the first OpenJDK 8 release candidate became available.
From our perspective, Spring Framework 4 on Java 8 is a great combination in many environments, not just with Tomcat, Jetty or WildFly but also with recent embedded engines such as Reactor or Undertow, and other kinds of custom application architectures.
Six days later, Spring 4.0.3 was released. The difference? This version of Spring "is built with OpenJDK 8 GA" and "includes the latest ASM 5.0.1 (with bytecode support at the JDK 8 GA level as well, superseding the custom ASM 4.2 fork that we were previously using)". In addition to bonafide Java 8 support, Spring's 4.0.3 release has seen a lot improvements in the WebSocket space. From our review it appears that all of the issues noted in Prashant Deva's article, titled A guide around Spring 4's buggy Websocket support, are fixed as part of this release.
Spring Boot went GA earlier this month and Chris Beams has done a nice job of showing how they built spring.io with Boot. The Pivotal development team has been aggressive in supporting Java 8, as well as promoting their support for using other languages with Spring Boot.
Interesting aspect about #SpringBoot: it's not about Java VS. Groovy VS. Scala. It's about a mature platform + your JVM language of choice…— Oliver Gierke (@olivergierke) April 1, 2014
Have you tried upgrading your apps to use the latest versions of Spring and Java? If not, what's holding you back?
Mike Keane Dec 21, 2014
Jeremy Stieglitz Dec 21, 2014