Tiger Roars:
The Release of Java 2 Platform, Standard Edition (J2SE) 5.0, an Interview with Sun Fellow Graham Hamilton
Java 2 Platform, Standard Edition 5.0 (J2SE 5.0), the most extensive update of the Java platform since its inception in 1995, has arrived. The new release (code-named "Tiger") is designed for exceptional quality, improved ease of development, greater speed, enhanced performance, and extended monitoring and management capabilities.
To get up to speed on J2SE 5.0, we met with Graham Hamilton, Sun Fellow in the Java platform team at Sun Microsystems. Hamilton was the lead architect for J2SE releases 1.3, 1.4, and now, 5.0. His current projects include planning for post-Tiger JDK releases, an Ease-of-Development initiative across J2SE and Java 2 Platform, Enterprise Edition (J2EE), and work with Sun's tools group on new tools initiatives.
Gaining Familiarity with J2SE 5.0 Developers can download the JDK here: http://java.sun.com/j2se/1.5.0/download.jsp
What is the basic take-home message about J2SE 5.0? What do you most want developers to understand about it? Tiger is a major and broad update across the entire core Java platform. It includes the first big set of language changes since the original Java language was released in 1995. But there are also significant updates to all main areas of the J2SE platform, from low-level virtual machine details to high-level GUI improvements.I'm also happy to report that Tiger looks like our highest quality J2SE release ever. Quality had been job #1 throughout the release development and this has paid off. In his recent blog, Mark Reinhold, Chief Engineer for J2SE, talks about how well we are doing on our various quality metrics.
An Easier Time for Developers
How does Tiger make life easier for developers? In many ways. For example we've added generic types, which allow the language and the compiler to do more type checking for you. Developers who worked with the Java collection libraries previously had to hold a lot of type information in their heads, and the language couldn't keep track of it for them. Now, generics lets you specify that type information as part of your source file. The compiler can do more checking for you and get rid of a bunch of casts you had to do previously. Generics makes developers more productive and programs more reliable.We've added a number of other smaller language changes to help developer productivity. This includes simplified iteration over collections and arrays -- the so-called "enhanced for loop" syntax. We've added what we called boxing and unboxing to automatically map between primitive types and object types. Those are both fairly small language changes, but they simplify common tasks for developers.
As part of the ease-of-development work, we've also added support for "C" style printf. Many of us who came from a "C" background appreciate the power and simplicity of printf for simple formatting. Now you can use printf with the Java language.
Another big change is Java language annotations (JSR 175). This supports a style of declarative programming within the Java language, which started as a classic object-oriented language, full of imperative operations such as "x.doThis()" and "y.doThat()". However, as the libraries evolved, a declarative style of programming slowly crept into the platform. For example, with JavaBeans you can use particular method naming patterns, getFoo and setFoo, to define a JavaBeans "foo" property. Similarly, as part of serialization we specified that the inheritance of a particular marker interface could be used to indicate that a class was serializable. Enterprise JavaBeans also invented a variety of marker conventions to specify how EJBs work.
"I'm happy to report that Tiger looks like our highest quality J2SE release ever. Quality had been job #1 throughout the release development and this has paid off."
- Graham Hamilton,
Sun Fellow in the Java Platform Team, Sun Microsystems
Now, in stepping back, we realized two things. First, a variety of these kinds of marker techniques had crept into the Java platform. Second, they were being highly effective. They were allowing developers to declaratively mark methods or classes as having a particular characteristic and then tools or libraries would perform special processing on those classes or methods. This reduced and simplified the amount of explicit programming that was necessary.
But the marker conventions we were using were rather ad hoc and were proving difficult to generalize into richer uses. So with Tiger, we've added the idea of declarative programming as a first-level concept in the Java language itself. There is now a mechanism where you can define annotation types, and then use those types to annotate classes, fields, and methods. And then tools and libraries can process those annotations and do work on the developer's behalf. This isn't just a theoretical concept. This is something we're pursuing as one of the main programming styles in J2EE 5.0, particularly in projects like EJB 3.0. This use of annotations looks like it will help considerably simplify J2EE programming.
Take us through the six major themes of Tiger. Theme #1 is quality. By quality, we mean stability, robustness, and compatibility. We want your earlier applications to just plain work with Tiger. We want to maintain previous behavior. We want this to be a release that can stay up for months or years at a time.As part of developing the releases we have treated quality as indisputably job #1. For example, we have been working to improve many of our internal engineering processes so as to more carefully manage change, to improve testing efficiency, and thus to improve overall release quality. I think this focus has been very effective.
A second major theme is performance and scalability. As part of our work on garbage collection we've tested with heaps of over 500 gigabytes of physical memory. Similarly, we've made sure that the JVM can run on extremely large multi-processor systems. (The Sun hardware guys are very kind and sometimes let us borrow some of their very biggest and shiniest toys.) Now I wouldn't necessarily recommend a 500 Gig heap or a hundred-way processor for home use quite yet. It's nice that we can scale to the very high end, but we are mostly tuning and testing on much more mundane systems.
Now, in looking at how customers actually deploy to large systems we realized we had been suffering from a flawed assumption. Historically, we've provided very detailed configuration flags to let you manually configure the JVM to best exploit server class systems. If you knew how to set the right flags, you could really boost your performance on large systems. However we've now realized that we got a little too carried away with all these configuration options and in practice many customers ignored most of these options.
So one of the things that we're introducing in Tiger is what we call performance ergonomics, where at JVM start-up the JVM will analyze the kind of environment it's in, and will now automatically configure these fancy options that you used to have to set manually. For example, if you are on a large server system with lots of memory, it will use aggressive heap options targeted for high throughput. If you want to, you can still manually configure all these options, but my advice would be to initially just try it with the defaults. This may now work even better than doing hand configuration.
"With Tiger, we've added the idea of declarative programming as a first-level concept in the Java language itself."
- Graham Hamilton,
Sun Fellow in the Java Platform Team, Sun Microsystems
The third big theme is monitoring and manageability. The goal is to make it easier for developers to see what's going on inside the JVM and inside Java applications. We've added new APIs to expose performance and management information. We're also delivering some simple monitoring and management tools as part of the J2SE 5.0 release. For example, we're including a simple JConsole tool, that lets you look at a variety of management information, including things like heap usage and the number of threads that are running.
The fourth theme is the desktop client. We've worked to improve both the performance of the Java desktop client, but also the GUI look-and-feels. We've continued to improve the quality of the Windows XP look-and-feel and the GNOME GTK look-and-feel. We've also added a new cross-platform look-and-feel called "Ocean" that provides a clean, modern, cross-platform look-and-feel.
We're also looking into the future with our GUI work and we've already starting experimenting with Tiger on some of the early Microsoft Longhorn builds. We know that the Longhorn release will be very important to desktop developers, so we're making sure that J2SE will run well and look great on Longhorn.
The fifth theme is ease of development, which we've already talked about. That includes various API updates including the printf facility I mentioned earlier. It also includes the new language features we talked about.
The sixth theme is core XML support. We've upgraded the core XML support provided in J2SE by adding new versions of the SAX parser, the DOM Document Object Model, and the XSLT transform engine.
XML and Web Services support on the Java platform continue to evolve quickly. You can get the very latest XML and web services support as part of the Java Web Services Developer Pack (JWSDP) from java.sun.com. Over time, as those ideas stabilize, we'll import them into future releases of J2SE.
The Most Important Feature of Tiger
If you were pressed to name one thing as the most important about J2SE 5.0, what would it be? Well different people will probably make different choices. For example, I know many people really like generics. But personally, I think the single most important feature in Tiger is JSR 175 annotations, and that's largely because of the impact it's having on J2EE 5.0 going forward. For example, take a look at the recent public draft from BEA for Web Services metadata (JSR 181) or the recent early draft for EJB 3.0 (JSR 220) to see how they are using annotations.Want to learn more about J2SE 5.0? Got a question about J2SE 5.0? Join the October 12 online chat on New Language Features in J2SE 5.0 with guests Scott Seligman, Joe Darcy, and Peter von der Ahé.
Feedback from Developers
What kind of feedback are you getting from developers so far? We're getting very positive feedback about the release, especially on the new language features. I think most of the Java community is cautious about language change. People respect the great job James Gosling did with the original language design. But there is a lot of enthusiasm for generics, and boxing, and the extended for loop syntax, etc. Developers are telling us that these work well. We've had these and other features in beta for nearly nine months and people are very enthusiastic about what they're seeing.We're also getting good feedback on release quality. We think Tiger is going to be our highest quality J2SE release ever. We're not going to be able to fix every bug, I'm afraid, but we are trying to make sure that the overall quality is high, and that this is a stable release that you can deploy on from day one.
It sounds like Tiger has been an enormous project. How has all this work been handled?"I think the single most important feature in Tiger is JSR 175 annotations, and that's largely because of the impact it's having on J2EE 5.0 going forward."
- Graham Hamilton,
Sun Fellow in the Java Platform Team, Sun Microsystems
We've benefited from very broad Java community engagement in creating Tiger through the Java Community Process (JCP). There were 15 component Java Specification Requests (JSRs), each with a strong cross-industry expert group working together to create the new specifications. Thank you everyone! Companies such as IBM, BEA, Oracle, and many others helped to drive and refine those specifications. In addition, we are also very grateful for the detailed and pragmatic contributions from academia -- Professor Doug Lea and Professor Bill Pugh each led a key component JSR and drove it to success. Thank you!Sun has been the overall specification lead for Tiger and has coordinated the various pieces. From within Sun, we've had several hundred people who've worked on various aspects of Tiger, either in API design, or implementation, or even more importantly in platform testing and stabilization. The latter part is the least visible but in many ways the most important part of a big release like Tiger.
So Tiger has been a very big effort, but we think the final release is well worth it!
See Also
Graham Hamilton at 2004 JavaOne Conference
The All-New Java 2 Platform, Standard Edition (J2SE) 1.5 Platform: Programming with the New Language Features in J2SE 1.5
New Language Features for Ease of Development in the Java 2 Platform, Standard Edition 1.5: A Conversation with Joshua Bloch