Just about one month ago, Java 7 was released. The official project was opened by the Apache Software Foundation for its open source JSP and servlet container - Apache Tomcat. Since Java 7 is the latest version, many users are wondering if Tomcat 8 will support Java 7, or even if they should use it in Tomcat 7.
Mark Thomas, SpringSource engineer and ASF release manager for Tomcat 7 explains in a post this week how the two relate.
In short: it has yet to be determined if Java 7 will be part of Tomcat 8, and while Tomcat 7 will never officially support Java 7, there are work arounds to getting it to work, but right now you should hold off on using Java 7 in production with Tomcat 7.
How Will It Be Decided If Java 7 is in Tomcat 8?
Within the J2EE specification, which governs Tomcat's official direction, there are three specifications that need to be made: Servlet, JavaServer Pages (JSP) and Expression Language (EL). Once a new version of the J2EE specification is released, the next major version of Apache Tomcat is updated. Apache Tomcat 8 will require the minimum Java version specified by the Servlet specification. The hope is for that to be Java 7, but nothing will be for certain until the specification is finalized.
What Will Java 7 Give Tomcat 7 Users?
Thomas explains in his post the basics, that you will be able to write Servlets and JSPs - however any new features (which he couldn't think of many cases where it would affect these pieces), you may encounter portability issues. He also warns:
If Java 7 follows the pattern of previous releases, there should be a noticeable performance improvement using Java 7 over Java 6. As with anything performance related, you'll have to test it in your environment to see what the actual effect is.
Should I Use Java 7 Now?
While eager to jump into the Java 7 community, it should be noted that in its first release there has been at least one high profile bug in the Apache product (please refer to the Lucene project) and Java 7 causing problems with crashing. Thomas also gives other examples of issues he has noticed with Java 7, explaining:
I have also noticed some SSL issues when using Java 7 with CLIENT-CERT authentication that I haven't had a chance to dig into yet. While certainly we can expect bugs like this to be fixed and performance to improve in the long run, before Tomcat 8 is available, it is recommended that you stay away from Java 7 in production for a little while longer, or that if you do embrace it, be sure to do extensive testing before releasing any mission-critical applications.
Don’t expect Apache Tomcat 8 to be ready for release over night. With the specifications still in the very early stages, Tomcat 8 is slated for its first stable release next year, or maybe even longer. For more information and to read the entire blog post, click here.