Welcome!

Java Authors: Frank Huerta, Adrian Bridgwater, Pieter Van Heck, Esmeralda Swartz, Gary Kaiser

Related Topics: Java, Wireless, AJAX & REA

Java: Blog Feed Post

Ellison at JavaOne: Myths About JavaFX, Android, and J2ME

At JavaOne, Larry has made some very encouraging statements about Oracle’s commitments to Java and JavaFX

At JavaOne, Larry Ellison has made some very encouraging statements about Oracle’s commitments to Java, JavaFX, and the mobile developer market. It is certainly good news that Oracle (i.e., Larry) sees the significance of the Java platform in its integrality. However, there are many misunderstandings about the relationship between Java, JavaFX, and Android that even confuse the new Java owner. Here are some clarifications.

1) JavaFX is NOT Java
Obviously, from a marketing standpoint, JavaFX is branded as Java; however, technically JavaFX is a language by itself, which happens to be compiled into Java bytecode and run on a Java VM. JavaFX is similar to Groovy or JRuby, minus the dynamic part (see #2). For example, introspecting a JavaFX object from Java requires some tricks since JavaFX Object/Class definitions do not map directly to those of Java Object/Class. (Note: Sun has been trying to brand JavaFX beyond the JavaFX Language itself, but so far most developers see JavaFX as the language)

Larry Ellison speaking at JavaOne 2009 [Photographer: John Todd / Don Feria]

2) JavaFX is NOT a scripting language.
Even though it is called JavaFX Script, JavaFX is NOT a scripting language (in the dynamic sense). JavaFX code gets compiled to Java bytecode at design time. So, JavaFX is similar to Flex (except for the XML-UI part). Note that JavaFX started as a scripting language in Sun Labs, but quickly became a compiled language (probably for performance reasons). Sun keeps using the term “JavaFX Script” to distinguish the language from the JavaFX brand and to avoid using the word “language,” which would make it too obvious that JavaFX is another language all together.

3) Android is NOT a Java-based device.
Here again, some confusion could come from Larry’s keynote address. Some might believe that Android is Java-based and that it runs Java. However, Android is NOT Java based; it is Linux based. Google Android SDK cross-compiles Java code to Android native bytecode (similar to GWT that cross-compiles Java code to JavaScript/AJAX). Thus the developer codes with Java, but the device does not run Java. While it is possible to have Java VM for an Android phone, an application built with Android SDK does not run on Java when executing on the device. By the way, I still have not found JavaVM for my G2/HTC-Magic.

4) JavaFX cannot run on Android without a Java VM.
I would LOVE to be proven wrong (with an example) on this one. This is a discussion I had with my friend @cromwellian about getting JavaFX on Android. In short, the only practical way to get Java FX on Android would be to have a JavaVM on Android. The Android cross-compiling trick would be pretty complex to extend to JavaFX. As stated above, JavaFX is not only a library, but a whole different language, which gets compiled to Java bytecode. So the Android compiler will have to do quite a bit of work to move a Java/JavaFX application to a non-Java VM. It’s not impossible, but hard. GWT2 hard, I think. So, to recap, you can run JavaFX on Android, but you need a JavaVM (apparently JavaFX on Android has been demo in JavaOne -see 2:30-)

5) Java is NOT on most devices [that matter].
Sun likes to say that Java is on billions of devices (see 0:54). While mathematically probably true, practically, developers do not really care about Java for mobile. These days it’s all about iPhone, Android, Plam Pre, and mobile Web (not even Windows mobile). Most of these high-profile phones do not have Java out of the box, and getting a Java runtime can even be challenging. For example, there is no JavaVM out of the box on iPhone, Android G2/HTC-Magic, and Treo 750 WinMobile (I could not find one on my old Treo 750 WinMobile). And for the rest—well, the J2ME market is very fragmented. It is really hard to measure your reach when you develop a Java application for mobile devices. And the ironic part is that since JavaFX needs the latest and greatest JavaVM to run, it does not even run on the billions of billions of J2ME devices anyway. Some disagree with these statements noting that Java is on all Nokia and most Sony-Ericsson devices (see Jehtro’s comment)

As a software Architect/Entrepreneur, I truly like and use Java a lot, but I hate Kool-Aid. I really wish that Java and JavaFX will be successful on the mobile and PC market, but as a community, we need to assess the current state realistically if we want to accomplish our vision. That aside, I would agree with Scott: if Larry managed to convince Steve to put Java on iPhone (at 0:26), it would definitely be a game changer (however, this would be against Apple’s Wall policy).

As a side note, I am sure that the Open Office team got very excited when Larry told them they should port their application to JavaFX. Flying pixels should rule the world!

If you liked this article +1 on HN and R-Tweets are greatly appreciated.

Read the original blog entry...

More Stories By Jeremy Chone

Jeremy Chone is chief technology officer (CTO) and vice president of development and operations at iJuris, an innovative startup offering a rich Web application for lawyer collaboration and document assembly. In his role as CTO and vice president of development and operations, Jeremy is responsible for overseeing the company’s strategic direction for the iJuris service and technology as well as managing the service architecture, development, and operations.

Chone has more than 10 years of technical and business experience in major software companies such as Netscape, Oracle and Adobe where he has successfully aligned technology visions with business opportunities that deliver tangible results. In addition to a combination of technical and business acumen, Jeremy also possesses an in-depth knowledge of Rich Internet Application technologies, as well as holding many patents in the mobile and enterprise collaboration areas.

See Jeremy Chone's full biography