且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将模块声明注入JAR?

更新时间:2023-11-22 17:40:16

是的,这可以通过 - 补丁模块实现选项。此选项最常用于运行时,但它也可以在编译时使用:

Yes, this is possible with the --patch-module option. This option is most often used at runtime, but it also works at compile time:

javac --patch-module <module name>=<path to jar> module-info.java