Re: ModuleFinder can't find one module

Alex Orlov ooo_saturn7 at mail.ru
Tue Jan 31 18:07:54 UTC 2023


Thank you for your help. I think we’ve found the problem:  https://github.com/eclipse-ee4j/jstl-api/issues/241 
 
 
--
Best regards, Alex Orlov
 
  
>Вторник, 31 января 2023, 15:34 +02:00 от Alan Bateman <alan.bateman at oracle.com>:
> 
>On 31/01/2023 12:52, Alex Orlov wrote:
>> :
>> To create module finder I do:
>> ModuleFinder jarModuleFinder =
>> ModuleFinder.of(jarModulePaths.toArray(new Path[jarModulePaths.size()]));
>> To check found modules I do:
>> final Set<String> foundModulePaths = new HashSet<>();
>> for (ModuleReference reference : moduleFinder.findAll()) {
>>             var path = reference.location().get().getPath();
>>             foundModulePaths.add(path);
>>  }
>>
>findAll will find occurrence of all modules so it might be that the
>module in jakarta.servlet.jsp.jstl-2.0.0.jar has the same name as a
>module that is one of the preceding elements of the module path. Can you
>try this:
>
>java --module-path <dir>/jakarta.servlet.jsp.jstl-2.0.0.jar --list-modules
>
>and you should see the module in output. Then change your loop above to
>print the module names and see if it gets printed.
>
>BTW: In the above you are using URI::getPath. That returns the decoded
>path component of the file URI - you can't reliably use this as a file
>path, I think the code you want here is Path.of(uri).toString().
>
>-Alan
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jigsaw-dev/attachments/20230131/9aeaba00/attachment.htm>


More information about the jigsaw-dev mailing list