Java Reference
In-Depth Information
There's more...
Regardless of the targeted runtime, it is imperative that you specify the main JavaFX script
file. So for instance, if your application's main entry class is my.package.Main (that is, the
class where the Stage instance or the script-level run() function is declared), then you would
enter the fully-qualified class name in the space provided in the IDE settings (check out the
preceding two figures). That information will be added to the manifest file as:
Main-Class: my.package.Main
The runtime container uses this information to determine which class to use to boot up
your application. If you fail to provide that information, your application will not start properly.
If the class you specified is a code module (whereby it does not have a Stage declared nor
does it have a script-level run() method), nothing will happen when you attempt to run
the application.
See also
F Chapter 1 , Getting Started with JavaFX
Building and packaging your app with
An IDE makes it easy to build and package your JavaFX application; however, driving the build
process from a command-line interface may be the desirable approach (automated build
comes to mind). In this recipe, we will see how to use the javafxpackager command-line tool
to package and get your desktop application ready for deployment.
Getting ready
You should be familiar with using the command shell. We will assume that you have
properly installed the JavaFX SDK with the JAVAFX_HOME/bin added to your shell's
executable path. If you do not have the JavaFX SDK installed properly, you will not be
able to run the javafxpackager tool. To ensure that you have your environment set up as
expected, from a command prompt type javafxpackager - version , as shown next:
$> javafxpackager - version
$> javafxpackager 1.2.0_b233
You should get the version of the launcher currently installed (similar to the previous listing).
If you get an error, refer to the recipe Installing the JavaFX SDK in Chapter 1 , Getting Started
with JavaFX for details on how to properly install the SDK.
Search WWH ::

Custom Search