Newbie Jigsaw question: How should I use 'jmod hash'

Mandy Chung mandy.chung at oracle.com
Tue Jan 22 17:45:06 UTC 2019



On 1/22/19 4:59 AM, Andre Tadeu de Carvalho wrote:
> Em ter, 22 de jan de 2019 às 10:06, Alan Bateman <Alan.Bateman at oracle.com>
> escreveu:
>
>> On 21/01/2019 12:57, Andre Tadeu de Carvalho wrote:
>>> Hi,
>>>
>>> I am exploring the jmod utility and I am stuck with the following: I
>>> already generated the jmod file and I want to add a hash from the
>> dependent
>>> module in it. I asked the same question in StackOverflow:
>>> https://stackoverflow.com/questions/54269994/how-should-i-use-jmod-hash
>>>
>>> What I am doing:
>>>
>>> jmod create --class-path target/mods/A target/jmods/A.jmod
>>> jmod create --class-path target/mods/B target/jmods/B.jmod
>>>
>>> Where B depends on A. Assuming I understood the documentation right, I
>>> could add B hash into A.jmod. I am trying the following:
>>>
>>> jmod hash --hash-module B --module-path target/jmods target/jmods/A.jmod
>>>
>>> When I run jmod describe, the hash is still not there. What I am doing
>>> wrong? Can I use jmod hash the way I am using it?
>>>
>> I think you've run a bug with the `hash` option to update an existing
>> JMOD file.
>>
>> Can you change the pattern you specify `--hash-modules .*` and see if
>> that works for you? Alternatively, specify the --hash-modules option
>> when creating the JMOD.
>>
>> -Alan.
>>
>>
>> Hi Alan!
> Thanks for your response. I've tried to use the parameter --hash-modules
> with the pattern .*, but it didn't work. For now, I'm already creating the
> modules with --hash-modules.
> I've no further questions and thank you for your time.
>

I created an issue to track this jmod hash command bug.  jmod create 
--hash-module works.
   https://bugs.openjdk.java.net/browse/JDK-8217527

I think jmod hash --hash-module "A|B" would be another workaround.

Mandy


More information about the jigsaw-dev mailing list