Skip to content

Bundle KBean

Bundle a self-contained Java app (containing JRE) using jpackage and jlink tools.

This plugin creates a self-contained app and allows configuring the jpackage and jlink tools.

This integrates with ProjectKBean for project-specific setups, handles file system operations to prepare input directories, and invokes jpackage and jlink tools.

Creates a customized self-contained app

Thanks to jpackage and jlink tools, this KBean creates self-contained Java applications or installers tailored for the host system.

To create such a bundle, execute: jeka bundle: pack.

The application or installer will be created in [project dir]/jeka-output dir.

If you want to create this bundle along other artifacts while executing jeka project: pack, you need to specify the following property in jeka.properties.

@bundle.projectPack=true

Summary

Bundle a self-contained Java app (containing JRE) using jpackage and jlink tools.

This plugin creates a self-contained app and allows configuring the jpackage and jlink tools.

This integrates with ProjectKBean for project-specific setups, handles file system operations to prepare input directories, and invokes jpackage and jlink tools.

This KBean post-initializes the following KBeans:

Post-initialised KBean Description
ProjectKBean Adds the bundled application to 'project: pack' actions, if 'projectPack=true'.

This KBean exposes the following fields:

Field Description
customJre [boolean] If true, a custom JRE is created including only Java modules used by the application.
projectPack [boolean] If true, creates a bundled application along with the regular JAR when executing 'project: pack'.
includeRuntimeLibs [boolean] It true, the runtimes libs will be added in the packaged application, which may be not necessary whe using FAT jars.
jpackage.options.all.[key] [String]
jpackage.options.windows.[key] [String]
jpackage.options.linux.[key] [String]
jpackage.options.mac.[key] [String]
jlink.options.all.[key] [String]
jlink.options.windows.[key] [String]
jlink.options.linux.[key] [String]
jlink.options.mac.[key] [String]

This KBean exposes the following methods:

Method Description
jlinkHelp Prints jlink help on the console.
jpackageHelp Prints jpackage help on the console.
pack Packages the application into a bundle.
showModuleDeps Prints JPMS module dependencies on the console.