NumberGuess example - JavaFX script in an app client

Here is a JAR file containing the NetBeans project from which I built my JavaFX Script-enabled Number Guess example.  

If you are interested, download the JAR and expand it into a directory.  Then open it as a project from NetBeans.   The directory includes a JavaFXJars directory which is empty.  If you download the Filters.jar and javafxrt.jar files from the OpenJfx site and place them into that directory then the NetBeans build scripts as written should work to build the application.  Or you can download the JavaFX JARs to somewhere else and revise the build->packaging settings for the EAR application to point to where you have stored the downloaded JARs. 

This is all necessary because the JavaFX JARs are separate from the JRE; currently the most reliable way to make sure they are available to the client is to include them in the app.  (You could place them in the lib/ext directory of the Java SE installation you are using but then you need to make sure to set up any client system that way if you want a JavaFX script to run from the app client.  It's just safer to package the JARs with your app.)  I tried to upload the NetBeans project with those JARs in the JavaFX directory but the upload seemed to large.

As packaged, you need to have Java SE 6 on the client for this to work.  Otherwise the app client container will not find the required script-related classes in the Java runtime and will launch the main class instead of the main script.

After you deploy the EAR you can launch the client via Java Web Start using http://<host>:<port>/guess or directly by running the EAR project in NetBeans.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

News and musings on the technology I work on at Oracle.

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today