Monday, September 20, 2010

JavaOne 2010: JDK 7 and Java SE 7

For my first real JavaOne 2010 session, I am attending JavaOne 2010: JDK 7 and Java SE 7 in the large Hilton San Francisco Grand Ballroom A/B.  I normally write a blog post in its entirety before submitting it, but in this case I am going to continually submit this same post with updates as the presentation continues.  In other words, I will be updating this same post throughout the presentation.

There actually are other JavaOne sessions schedule during this same time slot, but there is a very large number of participants (near capacity) now congregated in the spacious Grand Ballroom A/B.  It's no surprise that many Java developers are interested in any news on JDK 7 and Java SE 7, especially with speaker Mark Reinhold's recent blog on Java 7 Plan A and Plan B and the recent announcement that Plan B has been accepted.

The "cover slide" for this presentation was titled "Java SE: The Road Ahead." Reinhold started with a brief history of Java. He mentioned Sun and Java 1.0, 1.1, 1.2, 1.3, and so forth with their relevant release years. He also quipped about "those that remember Sun."  Reinhold said he will be talking about some general themes during this presentation: productivity, performance, universality (JVM is not just for Java anymore), modularity, integration, and serviceability.

Reinhold stated that the "poster child for [Java] productivity" is Project Coin.  Reinhold demonstrated via animated slides how J2SE 5 allowed us to start using generic parameter types rather than raw types and how proposed changes in Project Coin will reduce the syntax developers must type when generic types can be inferred.  Reinhold showed slides with try-with-resource syntax.  In his example, he used allocation of an InputStream and an OutputStream within the try clause (parentheses after try keyword), but stated that any class implementing the appropriate interface (AutoCloseable) can be used this way.  In a final Coin-related slide, Reinhold summarized other coming features: Strings in switch, improve integral literals, etc.

Reinhold introduced the fork/join framework and referenced Doug Lea's work at and introduced the RecursiveAction interface.

Reinhold introduced Lambda Expressions ("closures") and discussed why these are superior to using inner classes. Reinhold also introduced "default methods," which he described as "more powerful than implementation inheritance but not as powerful as mixins."

Reinhold briefly described some overall guiding principles in development of the Java language. These include the idea that reading is more important than writing and a long-term perspective. He specifically mentioned the controversy surrounding generics erasure in J2SE 5. I was excited to hear Reinhold say that though it worked out for the time, it may be time to change it so that the JVM can "see" the generic types. I would love to see Generics Reification. Although it doesn't sound like it would be in JDK 7 or even JDK 8, I'm just happy to hear that Reinhold and Oracle developers are seriously considering this for the future.  I would trade almost all of the other advertised Java improvements to have Java generics reification.

Another "language future" that Reinhold brought up is the concept of a "value" keyword that would allow for significant suppression of the boilerplate code for data/value classes.

Many languages other than Java now run on the JVM.  Reinhold referenced Da Vinci Machine Project and related JavaOne presentations.

Reinhold discussed improvements to Java modularity showed the now-famous slide with the word classpath stricken out dramatically.  He introduced describing library dependencies with a module path and the command jpkg.  Although jpkg will build JAR files, there will be a new format jmod that could be generated and rpm can be created as well.

Reinhold brought up the issue of Oracle needing to bring its JRockit and HotSpot JVMs together.  Reinhold says the "plan going forward is to take the best of both." It sounds like HotSpot will be the basis for the converged JVM because there are more HotSpot developers available.

With the overview of what's likely to come now presented, Reinhold has moved onto discussing the Plan A and Plan B for future releases of Java.  Java 7 will be 2011 and Java 8 will be 2012.  Reinhold said it will not be five years from Java 8 in 2012 to Java 9.

Reinhold said that Oracle will continue to develop OpenJDK in the open community and stated that there are no plans to change licensing.  The plan is also to continue using Java Specification Requests for new features.  Reinhold referenced the OpenJDK download page and requested developers to try it out and provide feedback.

I felt a little sorry for the JavaOne presenters whose sessions were at the same time as this one. There were many abstracts in this time slot that looked interesting to me, ("Groovy and Concurrency," "Hands-on JRuby: Making Your Job Easier," "Script Bowl 2010: A Scripting Languages Shootout," and "Deploying Java Applications on the Web") but I knew from the beginning that I would be attending this presentation on JDK 7 and Java SE 7.  LATER NOTE: When I went to the Parc 55 for my scheduled session following this one, I noticed that at least the presentations there had good attendance during this hour.

Although there wasn't a whole lot of new details for someone who had read blogs on future Java versions, it was nice to hear definitively that Plan B is now the accepted plan and to hear confirmation of plans to keep OpenJDK and to keep current licensing in place.  I was probably most excited (newest information and important to me) to hear admission that it might be a good time to start thinking about generics reification.

No comments: