The title of this blog post is a Haiku that also has some poetic justice. In September 1992 the programming language named Oak that James Gosling created was first demonstrated on a PDA device named Star7. This device had a graphical interface and a smart agent called "Duke" to assist the user. The Oak programming language, named after the Oak tree outside of Gosling's window, was designed to be a new technology for programming next generation smart appliances.
Oak was subsequently renamed to Java, which went on to become a nearly ubiquitous language and runtime platform. Exactly twenty years after the first demonstration of Oak, tremendous focus and momentum is occuring in the Java embedded space. For example:
JDK 7u6, released a couple of days ago, contains a general-purpose port of the JDK to Linux ARM, making it available under the same licensing terms as Oracle Java for other platforms. This JDK release is aimed at the emerging ARM server market, and for the community working on development boards such as the BeagleBoard, PandaBoard and the Raspberry Pi. This port provides 32-bit binary for ARMv6 and v7, with full support for Swing/AWT, both client (C1) and server (C2) compilers and runs on most Linux distributions. Support for JavaFX on ARM is planned for an upcoming JDK release.
A new conference named Java Embedded @ JavaOne will provide business and technical decision makers, as well as Java embedded ecosystem partners, with a unique opportunity to meet together and learn about how they can use Java embedded technologies to enable new business strategies. This conference will occur during JavaOne 2012, and can be attended as a standalone conference, or as an add-on to the JavaOne conference. Learn more about the business session line-up.
One aspect of embedded Java that excites me is the ability to use a common language and UI toolkit to develop applications for devices, thereby drastically reducing the development and maintenance costs.
Java Embedded @ JavaOne promises to be a very exciting and useful conference, so I hope to see you there!
Note to reader: This "guest post" was written by Dr. James Thompson, who is using JavaFX to develop scientific applications. I've included a brief bio for Dr. Thompson after this post.
Java has a rich history in the scientific community. Applications and frameworks such as the NIH's ImageJ, CERN's Colt framework and Apache Commons Math library immediately spring to mind when working in scientific computing. My first exposure to Java in science came as a graduate student at Oxford. We needed to analyze many large noisy datasets, typically stacked (multi-page) TIFF image files. ImageJ and its excellent plugin framework was the environment of choice for this work. Other groups such as the Mosaic group at the ETH in Switzerland did similar work and have extended it beyond what we did a few years ago.
So where does JavaFX 2 come in? Well, in my recent work we've had a need to develop image analysis software yet again. It turns out this is a common theme in biology, physics and engineering labs nowadays. I decided to have a look into what was available on the JVM which was when I learned of the new Java FX 2 pure Java library. It instantly appealed as it was well documented, had plenty of examples and was free! Scientists are a diverse group too, so the ability to write once and run on Macs, Windows and Linux boxes is a massive bonus. In academic science these days you often find diverse backgrounds and amalgamations of people with broadly different skill-sets. A nice user interface, easy installation and pleasant work environment on the computer desktop is therefore imperative.
A few features stood out immediately as I began browsing examples and reading the API. These included in my order of priority: extensive graphing tools, ObservableList, easy integration with native file systems (open / save dialogs), a simple syntax, great API documentation, FXML and good Netbeans tooling. Later on Scene Builder came onto the scene (pardon the terrible pun). Having done some work with XCode for Cocoa on the Mac I thought it would be hard to stand up to it. I was wrong. Scene Builder was mature out of the box. Laying out 'AnchorPanes' or anything else for that matter is very straightforward. CSS integration also enables easy skinning for apps. This is generally much more difficult in other frameworks.
Living on the JVM and being pure Java, integration with other JVM languages is easy too. My recent forays into Scala have proven very fruitful with JavaFX. I've been building some fairly involved numerical analysis code, and it's very easy to code in Scala. I've been able to use JavaFX in pure Scala classes, extending the 'Initializable' interface and load FXML classes easily.
I've had to develop a few things building directly on the JavaFX framework, such as for example tools to load multi-page TIFF files and write various bit-depth TIFF data to JavaFX 'Image' objects. But generally plotting tools and data handling are a breeze with JavaFX 2.
IntelliJ IDEA, Netbeans and Simple Build Tool for Scala all enable mixed projects and help with building greatly. I stumbled across an sbt-javafx plugin a few days ago, which has enabled me to package my projects for distribution among my colleagues.
In short, if you have a need to develop applets for scientific work, need to load and save data with a GUI, plot graphs and get actual science done, JavaFX 2 has to be given some serious consideration! I can't imagine trying to do what I've been able to in any other framework. I hope more scientists decide to develop things with JavaFX 2, so that we can extend the body of open source code and make development even easier.
Please have a look at a couple of movies I made showing my GUIs in action. These projects are a work in progress, but demonstrate the power of JavaFX and its application to scientific computing front ends.
James did his PhD at Oxford in the Physical and Theoretical Chemistry Laboratory, researching membrane protein biophysics. After finishing, James went to Harvard Medical School for a year to work on an imaging project before moving to his present role as a post-doc at USC in Los Angeles this year. His work revolves around biophysics but uses techniques from molecular biology, chemistry, microscopy and computer science. James maintains interests in single molecule biophysics, membranes, imaging, protein structure and function and computation with Java, Scala and GPUs. His twitter handle is: drJamesThompson
Recent Comments