JavaFX (Pete's notes)

Installing the JavaFXPad (per the book)

As the book suggests on page 6, I web'd to http://download.java.net/general/openjfx/demos/javafxpad.jnlp and downloaded the .zip file. This installed ~/javafkplaf/OpenJFX-200710081507. To run the demos,
~/javafxplay/OpenJFX-200710081507/trunk/demos/demo/demo.sh

Installing the JavaFX compiler

By getting the latest build

I web'd to http://openjfx.java.sun.com/ and got javafx-M2-src.zip. The README says it needs ant version 1.7, so I used fink to install ant, but I still only got ant version 1.6.5. Sigh, I gave up this approach for now.

Per the instructions an Planet JFX

This is a slightly older version. I followed the directions at Planet JFX titled How to Download the Latest Compiler Build Instead of Building It

It says to "Download the latest OpenJFX Compiler build". It's an archive.zip file. I put it on my desktop, then did

sudo mv ~/Desktop/archive/openjfx-compiler /usr/local/share

It says to set my PATH variable, so I added this to my .bashrc:
# Set up JavaFX
#
if [[ ${HOST} = 'okapi' ]]; then
    pathadd /usr/local/share/openjfx-compiler/dist/bin/
fibr
It says Mac users need to do:
chmod ugo+x /usr/local/share/openjfx-compiler/dist/bin/javafxc
chmod ugo+x /usr/local/share/openjfx-compiler/dist/bin/javafx

After logging out and back in, I was able to do

okapi$ javafx -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode)
okapi$

Using the JavaFX compiler

The compiler is documented at Creating Rich Internet Applications With Compiled JavaFX Script Technology,.

As the above suggested, I copied the sample code to ~/javafxplay/mypackage and did

cd ~/javafxplay/mypackage
javafxc HelloCompiledJavaFX.fx
cd ..
javafx mypackage.HelloCompiledJavaFX

I got an UnsupportedClassVersionError, so for now I'm using JavaFXPad to learn the language.

Getting the JavaFX plugin for Eclipse

I installed Eclipse as described in my Eclipse notes, then installed the JavaFX plugin by following the directions at https://openjfx.dev.java.net/javafx-eclipse-plugin-install.html.
Address comments or questions about this Web page to the Network Engineering & Technology Section at nets-www@ncar.ucar.edu. The NETS is part of the Scientific Computing Division of the National Center for Atmospheric Research, which is part of the University Corporation for Atmospheric Research.