How to inject module declaration into JAR?
问题 Suppose I have some library lib.jar for which I do not have the source code (or it is written in some non-Java language which is unaware of modules yet). lib.jar does not have module-info.class and I do not want to use it as an automatic module, so I would like to inject module-info.class into it. I first generate module-info.java with the following command: jdeps --generate-module-info . lib.jar Suppose this generated something like that: module lib { exports package1; exports package2; }