beryx / badass-runtime-plugin

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

PackageCollection cannot access class jdk.internal.org.objectweb.asm.Type #83

Closed danielpeintner closed 3 years ago

danielpeintner commented 3 years ago

Hi,

I am running Gradle 7.0-rc-2 and the latest id 'org.beryx.runtime' version '1.12.2'. Java(FX) version 16.

When running jpackage task I get

Execution failed for task ':jre'.
> class org.beryx.runtime.util.PackageCollection (in unnamed module @0x46ca0b42) cannot access class jdk.internal.org.objectweb.asm.Type (in module java.base) because module java.base does not export jdk.internal.org.objectweb.asm to unnamed module @0x46ca0b42

Seems to be related to https://github.com/beryx/badass-jlink-plugin/issues/176#issuecomment-804767254 ?

mattwright324 commented 3 years ago

I have the same issue and submitted #81. Its an issue with support for JDK 16 seems like so both suggestModules and additive=true are broken. My workaround until it is fixed is to:

  1. Switch to JDK 15
  2. Run suggestModules
  3. Add these modules to your build.gradle runtime
    runtime {
    addModules("java.compiler", "javafx.base", ... everything it tells you)
    }
  4. Switch back to JDK 16
  5. Comment out additive = true if you are using it
  6. You now have a minimal JRE and jpackage should work
  7. Repeat 1-4 to update the list as needed when you add new things
siordache commented 3 years ago

Fixed in 1.12.3.