JavaFX 2.1 SDK Developer Preview Comes To Linux
Looking back at my series of blogs on the topic of JavaFX and Linux:
- Using JavaFX 1.0 On Linux (1148 days ago)
- JavaFX 1.1 Released: Still No Linux Version (1077 days ago)
- JavaFX 1.2 Fun For Linux and Solaris (970 days ago)
makes me feel it is natural for me to blog about another significant development between JavaFX and Linux, namely, the availability of JavaFX 2.1 SDK Developer Preview on the Linux platform.
I don't know about you, but I learned of the news on Twitter:
@AdamBien: JavaFX 2.0 Is Available On ...Linux: JavaFX 2.0 SDK is available for Linux as Developer Preview Download. Enjoy ... bit.ly/zCBCgp
The official announcement (3 days ago) is here.
The beta is a 32-bit release, and requires Ubuntu 10.04 or later or equivalent, and requires JDK 7 Update 2. To give it a spin, I downloaded the JavaFX 2.1 SDK Developer Preview for Linux, the *.tar.gz version of 32-bit JDK 7. Untarred them into the /opt directory, resulting in
- /opt/javafx-sdk2.1.0-beta
- /opt/jdk1.7.0_02
I use JetBrain's IntelliJ IDEA for my day to day Java development. And it is really easy to work with JavaFX 2.0 in IDEA. First I add the 32-bit JDK 7 Update 2 as a JSDK to IDEA. Then I create a Java project, change it's JDK to the 32-bit JDK (for me the default is JDK 6 Update 26 that comes with Ubuntu). Finally I add /opt/javafx-sdk2.1.0-beta/rt/lib/jfxrt.jar as a dependency to the main module of the newly created project.
That's exactly the same way I setup JavaFX projects on Windows and Mac OS X. Moreover, the code I write is also exactly the same as on Windows or Mac OS X. The following is a short screen capture video (in the open source Ogg Theora format that works on some browsers on some operating systems but not others (HTML 5 is great!)) showing how the Lissajous curve (Wikipedia page) example that I posted 15 days ago is working on my Ubuntu 11.10 box.
I just want to make one point about 32-bit vs. 64-bit software on 64-bit operating systems. (If you are on a 32-bit operating system, you cannot use anything 64-bit period.) Since JavaFX 2.1 contains native libraries, the size of the JDK must match the size of the JavaFX. Since the native portion of the JavaFX 2.1 SDk has dependencies beyond the JDK, all of those dependencies must be present in a size that matches the SDK.
Since I'm on 64-bit Ubuntu, most of the shared libraries are available as 64-bit. And not all of them are available as 32-bit shared libraries. That is the case for libavcodec.so.52, which is needed by JavaFX SDK's fxavcodecplugin.so for playing MP3 audio.
And another thing worth worrying is the video hardware. My PC is three years old and contains an Intel GMA 3100 video card. When I ran the program, Prism falls back to the Java2D pipeline.
I hope Oracle is also working on a 64-bit version of JavaFX SDK for Linux.
What this earlier than expected release of a Linux version of the JavaFX 2.1.0 SDK Developer Preview shows is that the JavaFX team is committed to the cross platform vision of Java, is serious about delivering compelling technologies to make it easy and enjoyable to develop rich client Java applications, and is putting JavaFx in a position to be leveraged by thoughtful developers and companies to fuel the next round of innovations. (Like Ruby before Rails, and Objective-C before iPhone and iOS,)
Today's St. Louis JUG Meeting Is Canceled
Just a note to let everyone know that we decided to cancel today's St. Louis JUG meeting due to inclement weather. We hope to reschedule the presentation in a future St. Louis JUG meeting.
JavaFX 2.0 Is Fun
I will be doing a JavaFX 2.0 presentation tomorrow at the St. Louis Java Users Group. As part of the preparation I wanted to deploy a JavaFX 2.0 applet to the world. I have picked the Lissajous curve example to show off the JavaFX 2.0's Path API and the properties and bindings framework.
You can access the page through this link. It works only on Windows XP SP3 running 32-bit browsers, and Windows Vista or Windows 7 running 32-bit or 64-bit browsers. Here's a screenshot of the example running as Java Webstart:
The screen design is inspired by Brian Coyner's Core Animation Fun House that he presented at the West St. Louis CocoaHeads. Thanks Brian.
The JavaFX code took a couple of hours to finish. The source code can be found here.
I hope to see you tomorrow at the JUG. Well, it's close to midnight here. So if you read this blog entry tomorrow, (by the time you read it tomorrow, tomorrow would have become today) I hope to see you today.