How to let an automatic module find its own resources in Java 9?

前端 未结 1 1629
青春惊慌失措
青春惊慌失措 2021-01-05 09:53

I am trying to get my application to run with Java 9, but unfortunately one of the plain jar dependencies, when it tries to load a resource using classLoader.getResour

相关标签:
1条回答
  • 2021-01-05 10:29

    Try to add an 'opens' declaration to the automatic module 'ivy'. That allows access to it's resources:

    java --add-opens ivy/<dot.separated.path.to.resources>=ALL-UNNAMED --module-path my-mod.jar:ivy-2.4.0.jar -m my.mod
    
    0 讨论(0)
提交回复
热议问题