On 12/15/2018 2:48 PM, Sverre Moe wrote:
Den lør. 15. des. 2018 kl. 18:44 skrev Andy Herrick <andy.herr...@oracle.com>:

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.
Tried
         '--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', project.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 
https://bugs.openjdk.java.net/browse/JDK-8213962)
I did not get any problems with using both --module-path and
--runtime-image with jpackage.

The result of JDK-8213392 was not that there was any problem creating the package, but that the packaged app would not run, because the modules from the --module-path arg are never included in the packaged app, or referenced in the vm args used when launching java.

It is not clear to me what  - new File(installDist.outputs.files.singleFile, "lib") - actually is. Is this already in the runtime you created (if so you do you need this line ?) (if not , 8213392 will prevent it from being included in your app.)


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"
     }

which jlink are you running here  /usr/java/jdk-11/bin/jlink or /usr/java/jdk-12/bin/jlink ?

in the first case you really are creating a Java 11 runtime with FX, in the second case you are creating a Java 12 runtime with FX from JDK-11

(assuming FX is what is in "/usr/java/jdk-11/jmods:${libDir}")


/Andy

Reply via email to