Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146486 Modular JARs as multi-release JARs
  3. JDK-8156499

Update jlink to support creating images with modules that are packaged as multi-release JARs

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b143

      Description

      The jlink tool will require updates to work with modular JARs that are multi-release JARs.

      Consider the following with jdk9/dev today:

      $ jar tf m1.jar
      META-INF/
      META-INF/MANIFEST.MF
      module-info.class
      META-INF/versions/
      META-INF/versions/9/
      META-INF/versions/9/module-info.class
      META-INF/versions/9/p/
      META-INF/versions/9/p/Main.class
      META-INF/versions/9/p/Type.class
      p/
      p/Main.class

      $ jlink --output myimage --addmods m1 --modulepath m1.jar:$JAVA_HOME/jmods
      Error: module-info.class not found for META-INF module

      The main issue is that jlink attempts to create the runtime image with all resources in the modular JAR, it should only read the module classes/resources that are appropriate for the target JDK version.

      Another part is that jlink doesn't know the target major version and doesn't have any ability to configure the ModuleFinder so that the module declaration for that release is used.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sdrach Steve Drach (Inactive)
              Reporter:
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: