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

Add jar tool support for Multi-Release Modular JARs

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • tools
    • jar
    • b120

      The jar tool needs updating to work with modular JARs that are multi-release JARs.

      One area that needs attention is the ConcealedPackages class file attribute, the tool will need to add/replace this in all module-info.class files. The concealed packages should be the same in all versions.

      Another issue is the service provider checking, here is how it is broken in jdk9/dev today:

      $ find classes/ -type f
      classes//META-INF/versions/9/module-info.class
      classes//META-INF/versions/9/p/Main.class
      classes//META-INF/versions/9/p/Type.class
      classes//module-info.class
      classes//p/Main.class

      $ jar cfm m1.jar mf -C classes .
      java.lang.module.InvalidModuleDescriptorException: META-INF.versions.9.p: Invalid package name: Illegal character at index 4
      at java.lang.module.ModuleInfo.invalidModuleDescriptor(java.base@9-internal/ModuleInfo.java:780)
      at java.lang.module.ModuleInfo.read(java.base@9-internal/ModuleInfo.java:91)
      at java.lang.module.ModuleDescriptor.read(java.base@9-internal/ModuleDescriptor.java:1821)
      at sun.tools.jar.Main.checkServices(jdk.jartool@9-internal/Main.java:1718)
      at sun.tools.jar.Main.run(jdk.jartool@9-internal/Main.java:281)
      at sun.tools.jar.Main.main(jdk.jartool@9-internal/Main.java:1535)

            chegar Chris Hegarty
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: