jpackage EA Build 0

Sverre Moe at
Sat Dec 15 19:48:40 UTC 2018

Den lør. 15. des. 2018 kl. 18:44 skrev Andy Herrick <andy.herrick at>:
> On 12/15/2018 11:26 AM, Sverre Moe wrote:
> Some feedback from using this new JDK12 jpackage.
> I have yet to find out how to specify the bundle resources. It tells to put them on the class path, but that cannot be right, as jpackage is module.
> Using default package resource [menu icon]  (add package/movies.png to the class path to customize)
> I meant to get back to you on this.  This is an incorrect warning message that needs to be fixed - I will file a bug.
> All resources for the app should be specified by combination of --input, --files, and --module-path

Would be helpful to see some examples how to combine these to specify
the package resources, as a part of the help output.
        '--input', "${buildDir}/deploy/package",
        '--files', 'movies.png',
        '--module-path', "${buildDir}/deploy/package",

> Why is --icon the only bundle argument that can be set on jpackage?
> Using custom package resource [menu icon]  (loaded from file /home/sverre/workspace/movies/src/main/deploy/package/linux/movies.png)
> not sure I understand this.

The menu icon for package resource can be set by either --icon or the
resource package/app.png. What I meant is there is no CLI argument for
the other package resources like "Menu shortcut descriptor", "RPM spec
file". Then why only have argument for icon.

> The project I am trying this on is a fully modularized JavaFX application.
>     task createInstaller(type: Exec) {
>         dependsOn createRuntime
>         dependsOn installDist
>         commandLine '/usr/java/jdk-12/bin/jpackage', 'create-installer',
>             '--verbose',
>             '--name',,
>             '--description', project.description,
>             '--vendor', "Smeaworks Inc",
>             '--install-dir', "/opt/smeaworks",
>             '--category', "Some/Category/Application",
>             '--module-path', new File(installDist.outputs.files.singleFile, "lib"),
>             '--module', "${mainClassName}",
>             '--runtime-image', ""${buildDir}/runtime
>             '--output', "$buildDir/jfx/native"
>     }
> the latest build contains bug JDK-8213392, which prevents using --module-path and --runtime-image together (see

I did not get any problems with using both --module-path and
--runtime-image with jpackage.

> but it would still be advisable to run jlink first from the original runtime image with the desired module path. to get a minimal runtime image for your app.

I didn't quite understand what you meant with this.
I did run jlink first to create a Java 11 runtime image which I used
with jpackager.
    task createRuntime(type: Exec) {
        dependsOn installDist

        doFirst {
            delete "${buildDir}/runtime"

        def libDir = new File(installDist.outputs.files.singleFile, "lib").path

        commandLine 'jlink',
            '--module-path', "/usr/java/jdk-11/jmods:${libDir}",
            '--add-modules', 'no.smeaworks.movies',
            '--output', "${buildDir}/runtime"

More information about the core-libs-dev mailing list