jlink RuntimeException: descriptor returns inconsistent package set

Jim Connors james.connors at oracle.com
Fri Feb 10 17:03:09 UTC 2017


On 2/10/2017 11:21 AM, Jim Connors wrote:
>
>> Can you re-create the JAR file for scoreboard with JDK 9's jar tool 
>> as a workaround for now? The reason you don't see the issue with 
>> com.jtconnors.socket is that it doesn't have any concealed packages 
>> and that is where jlink is tripping up.
>>
>> -Alan
>
> Jim Clarke, cc:ed on these emails just did exactly that and didn't 
> have any success with his attempt.  I will also try the same thing.
>
> -- Jim C
>

OK, here's the moral of the story:  Use the jdk9 jar utility.  This works:

    C:\tmp\scratch>jar --create --file scoreboard.jar --main-class
    scoreboard.fx2.Main --module-version 1.0 -C scoreboard .

    C:\tmp\scratch>jlink --module-path .;\Users\jtconnor\jdk-9\jmods
    --add-modules scoreboard --output reducedImage --compress=2
    --strip-debug

One interesting thing though.  jdeps on the scoreboard.jar file yields this:

    C:\tmp\scratch>jdeps -s --module-path . scoreboard.jar
    scoreboard -> com.jtconnors.socket
    scoreboard -> java.base
    scoreboard -> java.logging
    scoreboard -> java.xml
    scoreboard -> javafx.base
    scoreboard -> javafx.controls
    scoreboard -> javafx.graphics
    scoreboard -> javafx.media

Whereas the jlink image includes additional modules:

      C:\tmp\scratch>reducedImage\bin\java.exe --list-modules
      com.jtconnors.socket
      java.base at 9-ea
->  java.datatransfer at 9-ea
->  java.desktop at 9-ea
      java.logging at 9-ea
->  java.prefs at 9-ea
      java.xml at 9-ea
      javafx.base at 9-ea
      javafx.controls at 9-ea
      javafx.graphics at 9-ea
      javafx.media at 9-ea
->  jdk.jsobject at 9-ea
      scoreboard at 1.0







More information about the jigsaw-dev mailing list