JavaFX isn't available for Linux and OpenSolaris yet. As to why, I suggest you read Josh Marinacci's blog: A Word on Linux and Solaris Support. However, this hasn't stopped the community from documenting how to install JavaFX on Linux. And not surprisingly, those instructions work very well for OpenSolaris. With some minor adjustments, here are the exact steps I to took to get the JavaFX SDK running in NetBeans on OpenSolaris.

Step 1. Install NetBeans

The NetBeans IDE makes working with the JavaFX SDK much more enjoyable. You'll need NetBeans 6.5, if you don't already have it installed:

bleonard@opensolaris:~$ pfexec pkg install netbeans

PHASE                                          ITEMS
Indexing Packages                            554/554 
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                  22/22   5931/5931 204.40/204.40 

PHASE                                        ACTIONS
Install Phase                              7387/7387 
Reading Existing Index                           9/9 
Indexing Packages                              22/22 

Step 2. Downoad the NetBeans JavaFX Plugins

The JavaFX Plugins can be found here: http://updates.netbeans.org/netbeans/updates/6.5/uc/final/stable/modules/javafx/. We'll use wget to download them:

bleonard@opensolaris:~$ mkdir javafxnbms bleonard@opensolaris:~$ cd javafxnbms bleonard@opensolaris:~/javafxnbms$ wget -r -l1 -np -nH --cut-dirs=9 -A.nbm http://updates.netbeans.org/netbeans/updates/6.5/uc/final/stable/modules/javafx --12:02:12-- http://updates.netbeans.org/netbeans/updates/6.5/uc/final/stable/modules/javafx => `javafx' Resolving updates.netbeans.org... 72.5.124.114

... FINISHED --12:05:10-- Downloaded: 68,475,450 bytes in 25 files

Step 3: Install the JavaFX Plugins

  1. Start NetBeans and select Plugins from the Tools menu.
  2. Select the Downloaded tab and click the Add Plugins... button
  3. Browse to the javafxnbms directory, select all of the plugins and click OK.
  4. Uncheck the JavaFX Weather Sample, JavaFX 1.0 and JavaFX Source Debug plugins.  These plugins are leftovers from the Preview SDK and will fail to install. Your Plugins dialog should look as follows (click to zoom):



  5. Install the 18 selected plugins. When the plugin installation finishes, NetBeans will automatically restart. Don't worry about any exceptions you may see, because we haven't installed the SDK yet.
  6. Quit NetBeans.

Step 4: Install the JavaFX SDK

  1. NetBeans plugin files (nbms) are standard zip archive files. One of the plugins downloaded was the SDK for OS X. Assuming you're still in the javafxnbms directory:
  2. bleonard@opensolaris:~/javafxnbms$ unzip org-netbeans-modules-javafx-sdk-mac.nbm ... inflating: main/main.properties inflating: main/org/netbeans/javafx/install/Install.class

  3. Create a directory under NetBeans for the JDK.
  4. pfexec mkdir /usr/netbeans/javafx2

  5. Copy the contents of the extracted plugin to NetBeans:
    pfexec cp -r netbeans/* /usr/netbeans/javafx2/
  6. Make the SDK's binaries executable:
    pfexec chmod +x /usr/netbeans/javafx2/javafx-sdk1.0/bin/*

Step 5: Learn/Play

Start NetBeans. There are a bunch of JavaFX Sample projects. To create one, select File > New Project and then Samples > JavaFX under the categories. For example, here's the DisplayShelf (click to zoom):



To get started with learning JavaFX, check out the tutorials.


Comments:

It works even better if you install JDK6u12 on Solaris: it has a number of fixes to X11 support, in particular: translucent windows. Startup time and anti-aliased rendering performance also got a boost. This version isn't yet in the OpenSolaris update repository, but it will be soon.

Posted by James Gosling on February 05, 2009 at 04:19 AM GMT #

Great news James, we wait it into OpenSolaris :)

Posted by Luca Morettoni on February 05, 2009 at 07:57 AM GMT #

[Trackback] Brian Leonard has posted a five-step tutorial.

Posted by Marina Sum's Blog on February 06, 2009 at 04:45 PM GMT #

Thanks for the nice and explanatory article!

Posted by Ankara Bilgisayar Bilgisayar Satis on February 19, 2009 at 08:41 PM GMT #

the instructions confront me with a chicken-and-egg problem

- if the javafx sdk (the mac-os one ) is not installed the plugins refuse to install because they require the javafx sdk (the Next button is 'grayed-out')

- if the javafx sdk (the mac-os one ) is installed netbeans refuses to start, unless I disable the javafx-sdk

what a pity

Posted by Luc Duponcheel on March 14, 2009 at 09:10 PM GMT #

btw:

I did not install netbeans as a package,
but installed it using netbeans-6.5-ml-solaris-x86.sh
instead

Posted by Luc Duponcheel on March 14, 2009 at 09:21 PM GMT #

I tried with the package based netbeans as well:
same problem

pffff...

Posted by Luc Duponcheel on March 14, 2009 at 09:59 PM GMT #

All work fine for me, now I have NetBeans 6.5.1 + JavaFX running... I hope (again) to see jfx running into Solaris and OpenSolaris as soon as possibile!!!

Posted by Luca Morettoni on April 06, 2009 at 10:31 AM GMT #

Works for me, thank you.

1. Make sure netbeans is installed in /usr/netbeans
2. Make sure to chmod +x all javafx binaries

Posted by Sly Slipstream on April 07, 2009 at 07:51 AM GMT #

@Sly all work fine for me too, and I have NetBeans installed into my home folder (I didn't installed it from pkg)...

Posted by Luca Morettoni on April 08, 2009 at 10:04 AM GMT #

@James: any hope to see JavaFX (and related tools) under (Open)Solaris? I think that couple could be a killer app...

Posted by Luca Morettoni on April 17, 2009 at 01:37 PM GMT #

thanks..

Posted by kelebek on April 26, 2009 at 09:48 AM GMT #

Same problem as Luc above ... any workaround ?

Posted by Sebastien Stormacq on May 03, 2009 at 02:00 PM GMT #

The JavaFX run-time is in the /dev repository and will be part of the OpenSolaris 2009.06 Live CD.

The SDK is scheduled to be available in the /extra repository very soon now.

Posted by David Comay on May 24, 2009 at 04:33 AM GMT #

thanks you

Posted by konyachat on November 26, 2009 at 12:43 PM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Roman Strobl