New features in JDK 6

I was planning to post this for a long time, but found the time now. I looked at the JDK 6 and some new features are very good. Though I have to really get hands-on with this version, i managed to look under the hood and come up with a concise and "usable-for-everybody" list of new things.

First thing first – This version is a great great improvement on performnace. I did not do any profiling, but our programs are starting much faster. We deploy an EAR on JBoss. JDK 5 used to take atleast 75-80 seconds on my machine to come up, but with JDK 6, its consistently below 65 seconds on the same machine. JIT has also been improved, so I think part of it is coming from there.

Other features:

1. Scripting for Java (JSR 223): Now scripting languages can be used with Java. You get best of both worlds – flexiblity of scripting languages and power of Java. JDK 6 bundles a scripting engine for JavaScript (based on Mozilla Rhino). It also supports third party scripting engines and if you go to java.net, you can downaload and use engines for all popular scripting languages like PHP, Python, Ruby-on-Rails, AppleScript etc. The engines for XPath and XSLT are also available, though I have to see how to use them.

Scripting is good in many ways, like dynamic nature (no need of giving a datatype to a variable). Generally, a scripting language is good in doing few operations in a very efficient way, like PERL for text processing. These features can be exploited for faster implementation. Other advantage could be to integrate the legacy scripting code with new Java applications.

The new tool ‘jrunscript’ has been added to try out the things in scripting way.

2. Desktop features: There are many new features, but two are worth mentioning. One is ability to show the splash screen and other is the system tray icon. These two features are very useful and the overall experience of Java application will be more like a native application. The other thing is, everybody was doing it anyway in their own way. Now its not required as Java is here to help you out.

3. I/O: Two new good features. A new class ‘Console’ is added. It provides support for reading the passwords from console without displaying them.

Other is, in the File class new utility methods have been added for getting the total space on the disk, total free space on the disk and total usable space on the disk.

4. Networking: In JDK 6, cross platform NTLM is supported. It also comes with a default Cookie Manager. However, the biggest is that now JDK 6 gives you all required classes for creating a light-weight HTTP server. In fact, it also comes with a default implementation.

5. Monitoring and Management: Its very easy to find the deadlocked threads now using ‘findDeadlockedThreads’ method in ‘ThreadMXBean’. This could be very useful in error handling specially for enterprise applications. The error handler can restart the application when it detects the deadlock.

New classes and methods have been added to get a list of locks owned by a thread and also to find which stack holds the lock for a monitor. Another method that can help in desiging better application experience is ‘getSystemLoadAveage’. Apart from cosmetic value, this can be used to take certain runtime housekeeping opeartions.

I have to see what will be the performance penalty on using these methods. From the name of it, they look pretty expensive.

JMX has been upgraded to JMX 1.4 in JDK 6. JConsole, the swing based JMX client is now officially supported. It doesn’t work with JBoss though as JBoss comes with its own JMX implementation.

It is facinating to see how Java has transformed itself into JMX-aware machine. Most of the thing are controllable/viewable through JConcole.

6. Tools Package: A new package (javax.tools.*) is given for using the Java tools in programmatically. The most useful one, I guess is JavaCompiler. It allows you to invoke the compiler programatically in a standard way.

7. Others:

a. Profiles and debuggers can now attach to running VM. The VM doesn’t need to be started in a debugging-capable mode. This will be a huge help in the diagnosis.

b. RMI calls can be made over SSL.

c. Few new Collection interfaces are added.

d. JAR tool will maintain the timestamps of the files while extracting them.

e. JAXB has become part of JDK 6. ‘xjc’ tool also comes with JDK now to generate the binding classes. However, there is no compatible ANT task (so far), so you will have to use ‘exec’ in the build scripts for using ‘xjc’

f. DerbyDB (formerly Cloudscape) is bundled with JDK. This can be used for DB operations in the development time.

I will post my experiments with this release in the coming days.

Advertisements

5 Responses to “New features in JDK 6”

  1. Broderickssportsfarm5499$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook Says:

    Broderickssportsfarm5499$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sport…

    Broderickssportsfarm5499$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsb…

  2. Triangulation Says:

    Somehow i missed the point. Probably lost in translation 🙂 Anyway … nice blog to visit.

    cheers, Triangulation

  3. nitin Says:

    it’s really nice

  4. etanoir Says:

    in the point 4, what is the version of NTLM? is it V1 and V2 or V1 only?

  5. bodog博狗 Says:

    How do I copyright the title and the content of an international online newspaper?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: