Auto updating launcher for JavaFX Applications. Combined with JavaFX native packaging, you get a native installer with automatic app updates.
You can see the launcher in action in this Demo Application.
- Maven Example with pom.xml
- Gradle Example with build.gradle
Check out the changelog for a list of all updates to the project.
See the launcher in action in this short screencast. There is also a video about customizing the update user interface.
FXLauncher is a 18Kb jar that can be used to boot your application. It knows the location of your application repository where you host all the app resources.
See a manifest example here. FXLauncher will look up the remote repository to check for a newer version of the manifest on each startup.
After the manifest is retrieved, FXLauncher synchronizes every file mentioned in the manifest while providing the user with a progress indicator. After all resources are in sync, a classloader is initialized with all the resources from the manifest.
Lastly, the application entry point retrieved from the manifest is invoked. Everything happens in-JVM, no restarts needed.
Before each run, the launcher will synchronize all resources and seamlessly launch an always updated application.
See the QuickStart projects at the top of the README for information on integrating FXLauncher in your build system.
FXLauncher can also be used to launch an application at an arbitrary url by specifying the --app
parameter at startup:
java -jar fxlauncher.jar --app=http://remote/location/app.xml
The native installer does not contain any application code, only the launcher. There is
no need to rebuild your native installer when you update your project, simply run the deploy-app
goal
and all users will run the newest version on their next startup. Point users to the fxlauncher.jar
or
to a native installer if you wish.
Check out these prebuilt installers for a more complex demo application
By default, the artifacts are downloaded to the current working directory. This is usually fine for native installers, but if you distribute your application via just the launcher jar, you might want to specify where the downloaded artifacts land. See the cache dir documentationfor more information.
Starting from version 1.0.12, FXLauncher will not download a remote version if the local version is newer. This is controlled
by comparing a timestamp in the manifest. Specifying --accept-downgrades=true
as the last argument to CreateManifest will
allow you to make sure that the version you have published will always be used by your clients even if they have a newer version installed.
This option is also available in the Gradle plugin as acceptDowngrades
.
It is also possible to embed the launchar jar in a native installer system like Advanced Installer - same approach as above, but without using javapackager. With this approach, you can choose wether to include a JRE or have the installer software preinstall it. Again, you are only distributing the launcher with the native installer, the rest is pulled down on demand.
FXLauncher uses a custom classloader to dynamically load the synchronized resources. This classloader is
then made available to the FXMLLoader
. You can access it via FXMLLoader.getDefaultClassLoader()
.
FXLauncher supports filtering of resources for the running platform. Any resource
that ends with -[mac|win|linux].jar
will only be downloaded and put on the classpath on the corresponding
platform. The manifest enforces this though the os
attribute in app.xml
.
There are two ways to customize the appearance of the update UI. Either you can configure the supported style properties in the manifest, or you can provide a custom implementation of the UIProvider to completely customize the UI. Have a look at this Custom UI Demo Project for more information about customizing the updater.