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

jlink should clearly report error when an automatic module is used

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b29
    • CPU:
      generic
    • OS:
      generic

      Description

      $ jlink --module-path $JAVA_HOME/jmods:clojure-1.8.0.jar --add-modules clojure --output foo
      Error: module-info.class not found for clojure module


      When jlink debug property is turned on, we get this:


      $ jlink --module-path $JAVA_HOME/jmods:clojure-1.8.0.jar --add-modules clojure -J-Djlink.debug=true --output foo
      Plugin system-modules threw exception during transform
      jdk.tools.jlink.plugin.PluginException: module-info.class not found for clojure module
      at jdk.jlink/jdk.tools.jlink.internal.ModuleSorter.lambda$readModuleDescriptor$0(ModuleSorter.java:64)
      at java.base/java.util.Optional.orElseThrow(Optional.java:385)
      at jdk.jlink/jdk.tools.jlink.internal.ModuleSorter.readModuleDescriptor(ModuleSorter.java:62)
      at jdk.jlink/jdk.tools.jlink.internal.ModuleSorter.addModule(ModuleSorter.java:72)
      at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
      at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:591)
      at jdk.jlink/jdk.tools.jlink.internal.ModuleSorter.<init>(ModuleSorter.java:57)
      at jdk.jlink/jdk.tools.jlink.internal.plugins.SystemModulesPlugin.transform(SystemModulesPlugin.java:156)
      at jdk.jlink/jdk.tools.jlink.internal.ImagePluginStack.visitResources(ImagePluginStack.java:274)
      at jdk.jlink/jdk.tools.jlink.internal.ImageFileCreator.generateJImage(ImageFileCreator.java:182)
      at jdk.jlink/jdk.tools.jlink.internal.ImageFileCreator.writeImage(ImageFileCreator.java:161)
      at jdk.jlink/jdk.tools.jlink.internal.ImageFileCreator.create(ImageFileCreator.java:100)
      at jdk.jlink/jdk.tools.jlink.internal.JlinkTask$ImageHelper.retrieve(JlinkTask.java:768)
      at jdk.jlink/jdk.tools.jlink.internal.ImagePluginStack.operate(ImagePluginStack.java:206)
      at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImage(JlinkTask.java:398)
      at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:263)
      at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:54)
      at jdk.jlink/jdk.tools.jlink.internal.Main.main(Main.java:33)

      It seems that a plugin reports that an automatic module being used as root because of missing module-info.class resource! jlink should detect attempt to use automatic module as root upfront and report error clearly.

        Attachments

          Activity

            People

            Assignee:
            sundar Sundararajan Athijegannathan
            Reporter:
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: