Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼

Eric Bruno

Dr. Dobb's Bloggers

JavaOne: JavaFX 2, Java on iOS

October 05, 2011

I've been at JavaOne all week and the experience has been fantastic. Oracle has put a lot of resources into ensuring that Java continues to be the number one developer platform, and the effort is bearing fruit.

Overall, Oracle doubled the space for JavaOne (it's within and between the Nikko and Hilton hotels on Mason Street), and attendance is twice what it was last year. Here is an overview of what Oracle has announced so far at JavaOne 2011 (details to follow in later blog posts):

  • JavaFX 2.0 with new all-Java APIs for Windows, and an early access release for Mac OS X

  • Java SE 7 preview for Mac OS X

  • Java EE 7 with integration into the cloud, and PaaS

  • Project Nashorn: JavaScript/Rhino implementation using InvokeDynamic (high performance, JIT, and so on)

  • JDK 8 plans: Project Lambda (closures), Project Jigsaw (modularization of JDKs and JVM)

JDK 8 will also add support for defender methods, which are default methods for when you extend an existing interface. In a nutshell, they help to maintain binary compatibility, and allow interfaces to evolve over time without breaking compatibility.

Project Jigsaw will work like Maven, and help you pull in just the parts of Java, bundled in specific packages, that you need. A new tool called jmod will be an improvement over the JAR utility, which will create other types of archives, such as RPM, deb, and other packages as needed.

Oracle is also striving for JVM Convergence between Sun's Hotspot and Oracle's JRockit with JDK 8. This should amount to internal improvements such as enhanced garbage collection, which will continue to improve JVM performance.

It didn't stop there. Oracle went on to discuss the beginnings of JDK 9. It's good to see long-term plans for Java, such as:

  • Self-tuning JVM: Attempt to eliminate the need for command-line parameters altogether, regardless of the application.

  • Improved Native integration: Make it easier and less cryptic to write native code.

  • Allow for "Big Data": Support for large heaps and data sets that are potentially hundreds of gigabytes in size, or larger.

  • Reification: Resolve the disjoint type system of primitives, i.e., int versus Integer.

  • Tail calls/continuations: Common in the JavaScript space with node.js, and allow for asynchronous method calls without threading.

  • Some others, without going into detail: meta-object protocol, multi-tenancy, resource management, and heterogeneous compute models.

Inside JavaFX 2.0

Oracle has stated that JavaFX 2.0 is Java's client technology going forward. This means that instead of Swing, JavaFX should be the API of choice for Java GUI application developers. It's also where the bulk of Oracle's effort will be focused for future GUI innovation. As for existing Swing applications, Swing will not be going away, and Oracle has worked hard to ensure that the JavaFX and Swing APIs will work together. This means that you can extend existing Swing applications with JavaFX 2.0; Oracle has provided full integration between the two. This is a direct result of Oracle listening to Java developers' concerns and requirements in this area.

Richard Bair and Jasper Potts went on to demo JavaFX 2.0 with a series of sample applications, the most interesting of which was a demo that included a Microsoft Kinect camera. Using JavaFX 2.0's advanced 3D and animation, along with the fact that it's all Java, they used a Kinect to move a 3D version of Duke on the screen as Potts moved around on stage. It was a powerful demo, and a real crowd pleaser.

Oracle also announced the new JavaFX Scene Builder, which is a rapid development platform for GUIs, along with a beta version of NetBeans 7.1 that fully supports JavaFX 2.0. All are available for download to try today.

Along with the JavaFX APIs, you can use FXML for UI markup, which is a way of defining the UI using XML. I suppose this may be similar to XAML in .NET.

JavaFX 2.0 and HTML5

Another crowd pleaser was the announcement of the new WebView component within JavaFX. WebView and WebComponent together provide full HTML4 (and partial HTML5) support for use within a JavaFX application. It renders full web pages with support for embedded JavaScript, and uses WebKit for all the heavy lifting. Using HTML5, you can now build composite Java and web-based client applications, where you can interact between your Java code and your page's JavaScript and DOM. For example, from Java, you can manipulate and replace parts of the DOM as needed.

Right now, JavaFX 2.0 is a separate download, but beginning in December, it will be integrated into Java SE 7, and will be included when you download the JDK.

Java SE and Java ME

As for Java SE, Oracle announced and released a preview version of Java SE 7 for Mac OS X. While it's in early access form now, Oracle plans to release it in final form by early 2012.

Regarding mobile Java's future, Oracle plans to align Java ME CLDC (for smaller, more constrained devices) with the latest Java SE language features, and synchronize releases from that point onward. This includes tooling, which will work across ME and SE. Oracle also plans to combine Java ME CDC with Java SE Embedded using the modularity features of JDK 8's Project Jigsaw. No solid time frames were given for this integration.

Oracle also announced full support and optimization of Java on ARM chipsets, with performance acceleration, and an enhanced C2 just-in-time (JIT) compiler, optimized for the ARM instruction set.

Java and JavaFX on iOS and Android

The most interesting announcement came when Oracle demoed both Java and JavaFX applications running on a Windows tablet, an iPad, and a "Linux-based tablet". To achieve iOS compliance, Oracle is working on an enhanced compiler that takes your Java application, unchanged, compiles it with the JVM built within it, and bundles it as a fully-compliant iOS application that meets Apple's requirements. Currently, this JVM is a variant of Java ME's CDC JVM, and depends on some enhancements that are not yet final, but this offers promise that Java applications will run on mobile devices and tablets in the near future.

Happy coding!

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.