beryx / badass-runtime-plugin

Create a custom runtime image of your non-modular application
https://badass-runtime-plugin.beryx.org
Apache License 2.0
161 stars 21 forks source link

=package-type error #46

Closed chrisrush1 closed 4 years ago

chrisrush1 commented 4 years ago

I have a working gradle build script that generates a fully functional exe on development machine using the badass-runtime plugin with jpackage. For some reason when the same build.gradle is run on the build server I see the following error:

“WARNING: Using incubator modules: jdk.incubator.jpackage “ “Error: Invalid Option [--package-type]"

The build server has the same Java 14 home as my development machine so uses the same version of jpackage. The build.gradle takes care of everything else so that should be the same.

I have the following in the jpackage script block:

jpackage {
    if (java_home14 == null) {
        throw new RuntimeException("java_home14 is not defined.")
    }
    jpackageHome = java_home14
    resourceDir = file("$buildDir/resources")
    installerType = packageType
    imageName = appName
    installerName = appName
   jvmArgs = jvmArgsList

  if (operatingSystem.isWindows()) {
        installerOptions = ['--win-dir-chooser',
                            '--win-menu',
                            '--win-shortcut',
                            '--win-upgrade-uuid', 'aabbccdd-eeff-1122-3344-556677889900',]
        imageOptions = ['--icon', appIcon]

    }

} Any thoughts as to what could be different?

Thanks

siordache commented 4 years ago

The --package-type option has been renamed to --type in build 14-jpackage+1-70 from 2019/11/12. The last release of badass-runtime-plugin is compatible with this jpackage build.

It seems that you currently use 1.7.2 or an older version of the badass-runtime-plugin in your build.gradle. Also, on your developement machine, java_home14 probably points to an older jpackage build. That's why everything still works fine there.

But on the build server, java_home14 probably points to the newest jpackage build, which is incompatible with your older version of badass-runtime-plugin.

Here's what you need to do:

  1. Configure badass-runtime-plugin 1.8.0 in your build.gradle
  2. Install build 14-jpackage+1-70 of jpackage on your development machine
chrisrush1 commented 4 years ago

Thanks for this solution and for for the plugin in general. I'll update the plugin version and double check the java 14 version on the build server.

Parth commented 4 years ago

This solved the problem for me, a vote to close this issue.