J2SE 5.0 Hits the Streetsby Chris Adamson
After two years of development, gobs of bug fixes, and at least one curious name change, a new major version of Java has been released. J2SE 5.0--it's best not to expand the abbreviation--delivers both under-the-hood improvements and significant changes to the API and to the language itself. Autoboxing, generics, and other language changes may lead to the most significant programming changes since inner classes were introduced way back in 1.1.
New versions of Java sometimes roll previously optional packages into the core, as is the case with 5.0. Java Management Extensions (JMX), along with a new client called JConsole, are now part of the JRE, so you can count on them being there. In "Monitoring Local and Remote Applications Using JMX 1.2 and JConsole," Russ Miles claims, "The combination of JMX 1.2 and JConsole in J2SE 5.0 brings Java application management and monitoring to the front line of Java development like never before." He supports this by setting up a simple monitored application, then shows how JConsole can reveal the app's memory stats, thread usage, and other metrics, locally or across the network.
Remote management is critically important when you've deployed your application to the field. As Sean C. Sullivan writes, "When your team has to support a mission-critical application, you can't afford to wait for users to tell you that the application is having problems. You need to be able to detect problems as soon as they occur." One simple solution is to extend your logging system to send log files back to you when serious problems are logged. In "Reporting Application Errors by Email," Sean shows how to set up log4j and java.util.logging to do this.
To subscribe to the ONJava.com newsletter (or any O'Reilly Network newsletters), visit https://epoch.oreilly.com/account/default.orm and select the newsletters you wish to receive in your user profile (you'll need to log in with your existing O'Reilly Network account -- if you don't yet have an account, you'll need to create one).
To change your newsletter subscription options, please visit https://epoch.oreilly.com/account/default.orm and click the"Manage My Newsletters" link. For assistance, send help to
Do you ever get hung up on the nit-picking of Java--a cast here, proper getters and setters there--and wish for something that was still as powerful as Java but maybe with a little more "whipupitude"? That would be, positively...Groovy. In "Groovy, Java's New Scripting Language," "Java Cookbook" author Ian F. Darwin offers a whirlwind tour of Groovy, the Java-based scripting language, which offers everything from servlets to Swing, with a heavy dose of hassle-reducing "syntactic sugar."
In this week's feature article from java.net, Jeff Friesen continues his investigation of concurrent programming in "Java Tech: The ABCs of Synchronization, Part 2." Along with showing a producer and/or consumer example of wait() and notify() coordination, he illustrates some of the hazards of doing thread synchronization on multiprocessor machines (and how Java's volatile keyword can help), and concludes with a tour of J2SE 5.0's new Synchronizers.
Finally, a note from editor in chief Daniel Steinberg:
I'd like to introduce you to Jon Mountjoy who has joined O'Reilly as managing editor of http://dev2dev.bea.com. If you would like to write for dev2dev, he would love to hear from you. If you have an article idea, or if you are willing to write and need an article idea, or if you would like to suggest an article you would like to see someone else write, please drop him a line at .
Please join us again next week.
Chris Adamson, editor