Can JavaFX make a play for rich Internet apps?

Sun's latecomer technology vies with established options from Adobe and Microsoft

With its new JavaFX technology for rich Internet applications, Sun Microsystems hopes to leverage the strength of the Java development base and Java's ubiquitous presence on devices to make a strong run in a race it has entered very late -- and where Adobe Systems and Microsoft have a huge head start.

If this competition were a race between Olympic runners, it might be broadcast like this:

"In Lane 1, we have Adobe with its Flash and attendant Flex technologies, downloaded millions of times and popular on high-profile sites like YouTube."

"In Lane 2, it's AJAX (Asynchronous JavaScript and XML), the popular RIA technique used in countless Web sites."

"In Lane 3, its up-and-comer Silverlight, backed by software giant Microsoft and used by NBC's prominent Olympics Web site."

"And in Lane 4, we have Sun's JavaFX used by Web properties such as -- well, it's still in development."

[ The InfoWorld Test Center rates the preview version of JavaFX as promising but not yet competitive with Flash and Silverlight. See why. ]

Sun believes JavaFX has a strong chance because it doesn't see there being just one winner. "This isn't the type of market where only one technology is going to win," says Jacob Lehrbaum, senior product line manager for JavaFX. But Lehrbaum acknowledged the course will be tough: "Clearly, we do have to compete for developer mindshare."

Forrester Research analyst Jeffrey Hammond thinks Sun has a shot, especially in the burgeoning market for applications running on mobile devices: "I think Sun has the opportunity to catch up very quickly in that space."

"I would say that the JavaFX platform looks very good. It has a lot of potential," said Andres Almiray, a software developer at Oracle. "It probably should have been announced three, four, five years ago," Almiray said. "The good thing is that it's finally here."

An anonymous blogger identified only as "geekycoder" lauded the technology: "Technically, JavaFX enables me to leverage [the] Java skill set and Java technology that I am more comfortable with to deliver a compelling RIA solution. Because synergy between JavaFX and Java is excellent and the fact that JavaFX is built on the Java platform means that I can ensure that I have one of the best and supportive platforms to work in. In addition, JavaFX will enable me to be more productive in making it easier and quicker to create RIA solutions," for Web 2.0.

The JavaFX road map
First revealed at the JavaOne conference in May 2007, JavaFX still is a work in progress. The official JavaFX Web page describes the project as "a powerful client technology for creating rich Internet applications with immersive media and content across the multiple screens of your life." It features the JavaFX Script scripting language for building rich Internet applications for desktop, mobile, TV, and other consumer platforms.

"JavaFX Script, the language of JavaFX, doesn't replace Swing, the core Java GUI toolkit, but provides an alternative way of programming that hopefully will bring Java technology to the masses," according to geekycoder.

A preview version of a software development kit for JavaFX for desktop applications, supporting Windows and Macintosh, was released late last month. Further deliverables are planned. JavaFX for Desktop 1.0, featuring a profile for desktop and browser deployments and a general-release SDK, is due this fall. JavaFX for Mobile 1.0, adding mobile support, is planned for spring 2009 release. TV support also is planned.

The JavaFX runtime is to be distributed with the Java VM. Licensing plans for device manufacturers also are to be revealed next spring. When manufacturers license Java Micro Edition, they will get the JavaFX mobile runtime.

JavaFX offers plug-in capabilities similar to Flash and Silverlight, but it also has a standard runtime -- the Java Virtual Machine -- to run applications outside a browser, Lehrbaum said. Other plug-in technologies will let developers use existing tools such as NetBeans or design tools such as Adobe Photoshop or Illustrator with JavaFX.

Why Sun thinks JavaFX will catch on
With JavaFX, Sun looks to build on the presence of Java on more than 2 billion handsets. Lehrbaum acknowledges that Java has been difficult to use, so those Java-based phones don't offer the kind of rich Internet experience found on Apple's iPhone, Palm's Palm OS, or Microsoft's Windows Mobile. He claims that "JavaFX takes that momentum and the advantages we have with Java but makes it much easier to create rich interactive and immersive experiences."

For example, JavaFX Script offers a declarative scripting language for developers to build interfaces in the way that they think about them, Lehrbaum says. "It matches the way they think about interfaces in their head and is very intuitive," he says.

JavaFX also revives the notion of client-side applets, which had been envisioned as the big win for Java in the mid-1990s. (Instead, Java took root as a dominant server-side technology.) With JavaFX, developers could build applet widgets for information access or a stock ticker.

To enable the applets revival, the Java Standard Edition SE 6 Update 10 release, due this month, will let developers write a single version of an application and run it on the desktop or in a browser. Lehrbaum claims the update will also make applet loading faster. JavaFX, meanwhile, makes it easier to build rich immersive experiences for such applets, he adds.

What early users think of JavaFX
The Java SE 6 Update 10 and JavaFX do in fact solve deployment issues for Java, says Jim Weaver, president of Java trainer jMentor, such as letting a Java or JavaFX application begin executing before the entire Java Runtime Environment has been downloaded.

Weaver describes JavaFX and the update as a "one-two punch." The update enables rich client Java to become a reality, Weaver says, whereas JavaFX Script provides the necessary simple scripting language.

JavaFX compiles down to byte code and runs anywhere the JVM runs. "You can use any Java classes within JavaFX," Weaver says. "You can leverage your Java skills with JavaFX."

"The platform promises a lot of new APIs and new abstractions to make the harder things simpler and the simpler things very easy," says Oracle's Almiray. For example, APIs and libraries take care of establishing the correct order of a drawing on the screen, he notes. JavaFX Script does offer some features not in Java, such as data-binding into the language, Almiray says. But he notes that some Java features -- such as annotations, generics, and inner classes -- are lacking in JavaFX. Almiray expects that JavaFX will succeed in the mobile arena, but says it will be tough to compete with Flex in rich Internet applications.

A muddled open source message
JavaFX initially was proclaimed to be a fully open source effort. But Sun has backed away from that stance. An FAQ page on a Sun Web site this spring reported that tools such as the compiler, runtime engine, player, and tools currently under development would not be open source.

The compiler, however, has been made open source, as have parts of the graphics libraries and some tools.

Sun plans to clarify its open source strategy for JavaFX with the Desktop 1.0 release, Lehrbaum says.

Copyright © 2008 IDG Communications, Inc.