{{ !articles[0].partner.isSponsoringArticle ? "Platinum" : "Portal" }} Partner

JavaFX SDK on Mac OS X with 32-bit systems (yeah, SoyLatte...)

As you know, the JavaFX SDK has been released a week ago for Windows and Mac OS X running on a 64-bit processor. The reason for the latter requirement is that JavaFX needs Java 6 and Apple's Java 6 is only available for 64-bit processors. So? What if you own, like me, a MacBook Pro Core Duo from the 32-bit generation? Need to switch to Windows or Linux? Btw, be aware that while Sun hasn't released an official Linux SDK, Weiqi Gao explained how to tweak the JavaFX SDK for Mac OS X to run under Linux.

Maybe not! If you have SoyLatte installed on your computer, you can run JavaFX SDK on it. Just follow these steps:

  1. Download the SDK for Mac OS X from http://www.javafx.com;
  2. Open the package and run the installer: you'll see that it refuses to go on without a valid Java 6.
  3. Open the terminal and go to /usr/bin; make sure that java is a symbolic link to SoyLatte (of course, take note of the existing link in order to restore it later). For instance:
    cd /usr/bin/
    sudo mv java java.old
    sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/soylatte16-i386-1.0.2/bin/java
  4. Now run the JavaFX SDK installer, that will work fine.

By default the SDK gets installed under /System/Library/Frameworks/JavaFX.framework/Versions/Current/ At this point you can try the samples available under /System/Library/Frameworks/JavaFX.framework/Versions/Current/samples: just unpack the sample you like and run ant. You need to set these environment variables:

setenv JAVAFX_HOME /System/Library/Frameworks/JavaFX.framework/Versions/Current/
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/soylatte16-i386-1.0.2/

At this point you can even use NetBeans with the proper plugins installed. Just make sure you run NetBeans on SoyLatte (you have to configure it on netbeans.conf; remember to add --laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel to netbeans_default_options or it won't start) and create a new custom "JavaFX platform" based on SoyLatte and on the JavaFX SDK you've installed previously. I've not been able to make it the default JavaFX platform, nor to remove the default "JavaFX SDK on Java 1.6 (default)" that will be broken, so you need to manually assign your custom JavaFX platform to all the projects.

You won't be able to see the JavaFX widgets in the editor preview (I've not understood why), but your applications will compile and run fine. I've tried with success all the examples in the JavaFX SDK. Of course, it is not guaranteed that everything will work, but it's better than nothing (and than being forced to buy a new Mac).


{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks