Launchcode is a native application launcher for Java based applications. It provides integration with target operating system and gives more native look and feel to Java-based GUI applications.
Launchcode provides binaries for the following operating systems and CPU architectures:
- Windows on Intel/AMD 64-bit CPUs
- Mac on Intel and ARM 64-bit CPUs
- Linux on Intel/AMD and ARM 64-bit CPUs
For Windows launchers, it is possible to embed icon into executable.
Backstage is released under Mozilla Public License 2.0. See LICENSE file for details.
Launchcode is packaged as Docker image and can be run on any platform where DOcker is supported. To generate launchers for all platforms, run the following command:
docker run -v ${PWD}:/workspace ghcr.io/bitshifted/launchcode:<version> config-file.yaml [output-dir]
This command mounts the current directory into /workspace
directory in container. Argument config-file.yaml
is a configuration file for installers generation. It is assumed that configuration file is in a present directory.
Argument output-dir
is the directory where generated launchers will be placed. This argument is optional. If not specified, default directory dist
will be used.
Generated installers will be placed in dist
directory inside the current directory. Contents of this directory will look like this:
dist
|- launcher-linux-x64
|- launcher-linux-aarch64
|- launcher-mac-x64
|- launcher-mac-aarch64
|- launcher-win-x64.exe
This section outlines the available options for configuration. Configuration file is in YAML format. Example file is shown bellow:
common:
jre-dir: runtime
restart-code: 20
jvm-options: -Xms=20m -Xmx200m
jvm-system-properties: |
-Dsome.property=1 -Dfoo.bar=baz \
-Danother.property=x
splash-screen: splash-screen.png
classpath: classpath/dir/*
module-path: some-directory
add-modules: |
javafx.core javafx.graphics \
javafx.fxml
module: mymodule
main-class: com.test.MainClass
linux:
splash-screen: splash-linux.png
jvm-options: -Xms=10m -Xmx=300m
mac:
jre-dir: Contents/runtime/jre
module-path: Contents/runtime/modules
windows:
icon: test-icon.ico
jvm-system-properties: |
-Dwindows.foo=1 -Dwindows.bar=baz
There are 4 top level sections, which basically have the same options.
common
- options for all platforms, unless overriden for specific platformslinux
- overrides common options on Linuxmac
- overrides common options on Mac OSwindows
- overrides common options on WIndows
Configuration options:
jre-dir
- location of JRE directory. It is assumes that path is relative to application root directory (on Mac OS, relative to bundle root)restart-code
- return code from Java application that will cause a restart. This is useful if you need to eg. restart after updatejvm-options
- options to pass to Java VMjvm-system-properties
- system properties to pass to JVMsplash-screen
- splash screen option to pass to JVM (ie.--splash:image.png
)classpath
- application classpathmodule-path
- application module pathadd-modules
- list of modules to add to applicationmodule
- module to launch. This options requiresmain-class
to be specified, so it can ba passed in formmymodule/MyMainClass
main-class
- application main classjar
- application JAR filearguments
- list of arguments to pass to applicationicon
- icon to embed in the launcher (applicable only on Windows)