Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8047305 JEP 238: Multi-Release JAR Files
  3. JDK-8153652

Update javap to be multi-release jar aware

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Withdrawn
    • Icon: P3 P3
    • None
    • 9
    • core-libs
    • None
    • Verified

      The javap tool must be updated to enable selection of versioned class files.

      Currently
           $ javap -cp version.jar version.Version

      will display the attributes of the base entry in a multi-release jar file (i.e. version/Version.class). If one wants to inspect versioned entries they need to specifically request a class through a jar url as in

           $ javap jar:file:version.jar\!/META-INF/versions/9/version/Version.class

      What we'd like to do is add a command line option to select the appropriate version of the class.

      It turns out that javap already has such a command line option, -multi-release. So one can select appropriate classes like this:

          $ javap -cp version.jar version.Version (for the base version)
          $ javap -cp version.jar -multi-release 9 version.Version (for the jdk 9 version)
          $ javap -cp version.jar -multi-release runtime version.Version (also for the jdk 9 version since runtime is equivalent to 9 on jdk 9)

      So all we really need to do is to document the option.

            sdrach Steve Drach (Inactive)
            sdrach Steve Drach (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: