BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Java SE 6 Update 10 is out but what does it deliver?

Java SE 6 Update 10 is out but what does it deliver?

After being in beta for about a year and having more than 1 million downloads, the Java SE 6 Update 10 (6u10) , dubbed the “Consumer JRE” has been released. With this release which is primarily focused on the Java Plug-In, Sun is trying to deliver on its promise for an enhanced rich client user experience and paves the way for the upcoming JavaFX Desktop 1.0.

In Java 6u10 the Java Plug-In has a completely redesigned architecture. Instead of executing applets in the same operating system process as the web browser, it runs one or more Java virtual machine instances which connect back to the browser for full interoperability with the surrounding web page. This architectural change offers many advantages and enables several new features:

  • Improved reliability. The JVM running the applet is isolated from the web browser at the operating system level. If something should go wrong while running the applet, or if an uncooperative applet refuses to shut down, the new Java Plug-In detects and handles the error condition gracefully; the web browser is unaffected.
  • Built-in JNLP support. The new plug-in offers the capability to launch applets directly from JNLP files, unifying deployment of Java content both in the browser and out of the browser (via Java Web Start). Developers can now reuse JNLP extensions for advanced functionality including the JavaFX run-time libraries, 3D graphics via OpenGL, and planetary-scale terrain visualization within applets. Applets can now access JNLP APIs for persistent data storage, local file system access, and other useful functionality from sandboxed code.
  • Per-applet command-line arguments. JVM command-line arguments may be specified on a per-applet basis, providing fine-grained control over options such as the heap size and Java 2D hardware acceleration features. JNLP-launched applets simply incorporate the command-line arguments and/or system properties into the JNLP file. Old-style applets can embed these arguments in the HTML of the web page.
  • Multiple JRE version support. Each individual applet instance may request a different JRE version on which to run. This feature is designed for enterprise customers which prefer to qualify their applets against either a particular JRE version or a particular JRE family. Both selection of a specific JRE version, or any in a particular family, are supported in the new plug-in.
  • Improved Java/JavaScript communication. The bridge between the JavaScript engine in the web browser and the Java programming language has been completely reimplemented. The new implementation is backward-compatible and features improved reliability, performance and cross-browser portability, for both Java calling JavaScript as well as JavaScript calling Java. Formerly Mozilla-specific "LiveConnect" functionality, such as the ability to call static Java methods, instantiate new Java objects and reference third-party packages from JavaScript, is now available in all browsers.
  • Improved user experience. The new Java Plug-In starts applets in the background, so the web browser always remains responsive. Applets appear on the web page as they become ready to run.
  • Improved applet lifecycle management. Calls to the applet lifecycle methods init, start, stop, and destroy are more deterministic and cross-browser behavior has been improved. The applet class loader cache and the legacy applet lifecycle, required for backward compatibility, are fully supported and the behavior of both has been improved.
  • Better large heap support. Historically, the maximum heap size that could be specified for applets via the Java Control Panel has been limited. This limitation is fixed in the new Java Plug-In; applets can now utilize as much heap space as command-line applications.
  • Better Windows Vista support. Signed applets running in Protected Mode Internet Explorer on Microsoft's Windows Vista now have the same privileges as normal user applications, eliminating a portability barrier to this platform.

The Java Plug-In is available for Internet Explorer 6 & 7 as well as Firefox 3 on Windows XP, Windows Vista, Solaris and Linux. It is not available for Mac users and Kirk Pepperdine thinks it’s going to be a while:

While one from Sun or apparently from Apple, can speak for when the 6u10 may make to Mac land, recent history has demonstrated that we could be waiting for some time.

Jim Weaver has managed to run JavaFX applets inside of Google Chrome beta. It seems that Chrome requires Java 6u10:

According to Google, Java SE 6 Update 10 is the version that must be used in order to run Java in the Chrome browser.  As I've mentioned previously, one of the objectives of Java SE 6 Update 10 is to solve the JRE and Java/JavaFX deployment issues.  Because Google Chrome is destined to be a great, cross-platform browser, and because it requires the version of Java that makes rich-client Java/JavaFX programs feasible, this will increase the adoption rate of JavaFX applets and applications.

With the JRE reaching the size of 14.5MB in previous versions, its distribution was a problem often criticized in the Java community. With 6u10 Sun has delivered enhanced deployment. The Java Kernel online installer lets first time Java users run applets and Java Web Start applications quicker without waiting for the whole Java Platform to be downloaded since the default Kernel is about 4-5MB. This installation is expected to satisfy the requirements of most Java applets and applications, and any additional libraries that may be required at runtime are downloaded to complete the Java Kernel installation. Additionally the Java auto-updater has also been improved, using a patch-in-place mechanism that allows users to update specific components of their Java platform instead of having to download and install a whole new JRE every time.

Also the Java Deployment Toolkit supplies Java based web applet/application deployers with a simple JavaScript interface that helps detect the users' Java environment and makes sure the correct version of Java is used:

The following HTML code is all it takes to ensure that Java 1.6 is installed and then a Java applet is launched:

<script src="http://java.com/js/deployJava.js"></script>
    
<script>
  deployJava.runApplet({codebase:"http://www.example.com/applets/",
     archive:"ExampleApplet.jar", code:"Main.class",
     width:"320", Height:"400"}, null, "1.6");
</script>

You can see deployJava.js for detailed description of the deployJava object.

One of the main features that were added to Java 6u10 was the Java Quick Starter (JQS), which improves initial startup time for most Java applets and applications:

JQS is enabled by default in Windows XP and Windows 2000 operating systems and is not necessary on Windows Vista as Vista offers its own pre-loading mechanisms. A process called jqs.exe will run in the background in order to allow quick startup. jqs.exe will be loaded after a Windows restart.

The startup performance improvement is achieved by periodically pre-fetching some of the most heavily used Java files into memory (occupying no more than 20Mb of RAM). Later, when Java is launched, much less disk I/O is required which makes startup much snappier and noticeably faster.

Also regarding performance Java  6u10 features a fully hardware accelerated graphics pipeline based on the Microsoft Direct3D 9 API, translating into improved rendering of Swing applications which rely on translucency, gradients, arbitrary transformations, and other more advanced 2D operations.

Moreover Java 6u10 offers a new cross platform look and feel that is drawn with 2D vector graphics and is named Nimbus. Nimbus is based on Synth which is part of Java since version 1.5 and tries to provide a polished-modern look to Java UIs. Since Nimbus is drawn entirely using Java 2D vector graphics, rather than static bitmaps, it's only 56KB and can be rendered at arbitrary resolutions. You can activate the Nimbus look and feel either by invoking UIManager.setLookAndFeel or by passing the -Dswing.defaultlaf command line option when running the Java application.

For more information on the Java platform check out the Java Community Content here on InfoQ.

Rate this Article

Adoption
Style

BT