Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8204256

improve jlink error message to report unsupported class file format

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 10, 14
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b19

      Description

      JDK 10 jlink outputs "Error reading module: jdk11/jmods/java.security.sasl.jmod" when linking JDK 11 modules which has a newer class file format version. The error message should be improved for example to output the cause of the exception.

      $ jdk10/bin/jlink --verbose --module-path jdk11/jmods/ --output test-image --add-modules java.base -J-Djlink.debug=true
      Error: Error reading module: jdk11/jmods/java.security.sasl.jmod
      java.lang.module.FindException: Error reading module: build/macosx-x86_64-normal-server-release/images/jdk/jmods/java.security.sasl.jmod
      at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:350)
      at java.base/jdk.internal.module.ModulePath.scanDirectory(ModulePath.java:284)
      at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:232)
      at java.base/jdk.internal.module.ModulePath.scanNextEntry(ModulePath.java:190)
      at java.base/jdk.internal.module.ModulePath.find(ModulePath.java:154)
      at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.newModuleFinder(JlinkTask.java:441)
      at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.initJlinkConfig(JlinkTask.java:372)
      at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:269)
      at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:54)
      at jdk.jlink/jdk.tools.jlink.internal.Main.main(Main.java:33)
      Caused by: java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor version 55.0
      at java.base/jdk.internal.module.ModuleInfo.invalidModuleDescriptor(ModuleInfo.java:1092)
      at java.base/jdk.internal.module.ModuleInfo.doRead(ModuleInfo.java:196)
      at java.base/jdk.internal.module.ModuleInfo.read(ModuleInfo.java:132)
      at java.base/jdk.internal.module.ModulePath.readJMod(ModulePath.java:395)
      at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:343)
      ... 9 more

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              igraves Ian Graves
              Reporter:
              mchung Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: