A "Hello World" application in JavaFX that is built using the JavaFX Maven plugin.
The main goal of this application is to demostrate the ability to build a JavaFX application and build it using Maven rather than the JavaFX Packager directly. In my experience, very few people or companies use Ant anymore; most folks are using Maven or Gradle now.
Through the use of the JavaFX Maven plugin, the build of a JavaFX application is greatly simplified, including being able to quickly create a native application.
Some links for documentation can be found at:
Build a Native App
mvn clean jfx:native(or
mvn clean install... the native packaging has been paired to the verify Maven phase)
- Look for the the installer, DMG, or RPM in
This will build an installer for whatever platform you are building on. Building on a Mac will produce a Mac app. Building on a Windows PC will produce a Windows app.
Building a Windows Installer and Native Application EXE
Building a Mac DMG or Linux RPM works straight of the box. However, Windows requires either WiX for MSI creation or Inno Setup for an EXE-based installer (both install an EXE for the JavaFX application along with a packaged JRE).
Both don't need to be installed, just whichever one gets you to your desired installer format.
Build an EXE Installer with Inno Setup
Follow the steps below to create an EXE-based installer with Inno Setup and the JavaFX Maven plugin.
- Download from Inno Setup's site
- Install it (I defaulted most of the installation options)
C:\Program Files (x86)\Inno Setup 5to your system
Once done, run
mvn jfx:native to create an EXE based installer at
By running the EXE installer, it installs the JavaFX application to the user's local app data folder, as well as an uninstaller entry in the
Programs and Features control panel. The application is also launched immediately following installation.
Build an MSI with WiX
To install WiX and have the JavaFX Maven plugin use it during a build, do the following:
- Download from WiX's site
- Install it.
C:\Program Files (x86)\WiX Toolset v3.7\binto your system
Once that is complete,
mvn jfx:native will create an MSI file in
Running the MSI installs the application to
C:\Program Files (x86)\(project name) without prompt. Additionally, it creates an uninstaller listing in the
Programs and Features control panel.