Rechercher dans ce site

Run and Deploy JavaFX applets on Linux Fedora

>> 13 April 2009

Working with JavaFX applets using NetBeans is really straightforward -even- on Linux. The only two things to take care of are :

1.Installation of JavaFX plug-in
2.Installation of Sun's version of Java

Tested configurations :

Fedora 10 64bits
Firefox 3.0.8

Note :
When you launch your applet in Firefox, JavaFX run-time will be downloaded and installed automatically.

Note :
Installing the JavaFX plug-in in NetBeans was detailed in a previous article

Use JDK or JRE of Sun Mircosystems

Download the last release of Java as .bin files on Sun's web site

Install .bin file/files if you have not already done this.

Note :
OpenJDK installed by default with Linux distributions has problems running applets

Note :
You can install more than one JDK and JRE on the same machine.

Do not uninstall or delete OpenJDK, other applications on your system need this.

$ chmod u+x jdk-6u13-linux-i586.bin

$ ./jdk-6u13-linux-i586.bin

Installing Java plug-in in Firefox

$ cd $HOME/.mozilla

Note :
.mozilla is the default Firefox configuration folder of the current user

Go to "plugins" folder
You can create this folder (if not found) in .mozilla

$ cd plugins

Link to in .mozilla/plugins

"" is the second generation plug-in. You can find it in JDK or JRE installation folder


Note :
In my example JDK is installed in $HOME ($HOME/jdk1.6.0_13_x86_64)

Note :
If you want to use the plug-in on a 32 bits Linux, replace "amd64" with "i386"

$ ln -s $HOME/jdk1.6.0_13_x86_64/jre/lib/amd64/

Create a JavaFX project in NetBeans

The following two links give you an idea about using JavaFX in NetBeans

Verify or configure Web Browser in NetBeans

Click on "Tools" -> Options


"No Proxy" is selected

click on "Edit"

Select Firefox

In Web Browsers -> Firefox

In Process -> Browse to or select your Firefox -> OK

Modify your project configuration to run and deploy applets

Right click on your project in NetBeans -> Properties

Run Options

Select "Run"
Select -> Browser (Configuration)
Select -> "Run in Browser" (Application Execution Model)

Wait ! Do not click on "OK" yet.

Application Options
Modify (if needed) applet's Width and Height -> OK

Clean and Build Project
Every time project's properties are modified -> right click on the project -> Clean and Build Project

Run the Applet
Right click on your project in NetBeans -> Run Project

Firefox is launched it began to download JavaFX run-time

Et voilà the applet is running in Firefox

Note :
If you encounter problems, this might be simply if Firefox is in "Offline" mode. In this case applet will not run.

File -> "Work Offline"

Uncheck " Work Offline "

Reload the page

How to deploy the applet on-line

-Edit projectName_browser.jnlp
In NetBeansProjects/projectName/dist

(my project's name is javafx-images. The file to edit is "/home/kas/NetBeansProjects/javafx-images/dist/ javafx-images_browser.jnlp")

-"codebase" tag must point to a server and a directory on this server

-Create a folder for the applet on the server

-Copy the following files to the applet's folder (on the server) from NetBeansProjects/dist


In my Example :

  • javafx-images.html
  • javafx-images.jar
  • javafx-images_browser.jnlp

Run the applet


Post a Comment

  © Blogger template Simple n' Sweet by 2009

Back to TOP