List modules in jar file

烈酒焚心 提交于 2021-02-06 09:58:14

问题


I've created what I'm pretty sure is a modular jar file. But if possible, I'd like to double check. Given a jar file, is there a way to determine what modules the compiler would find within it?


回答1:


The alternative is to use the jar --describe-module (-d for short), e.g.:

jar --file=myjar.jar --describe-module



回答2:


You can list the modules within the jar using the following java tool command:-

java -p yourModular.jar --list-modules

Edit: You shall preferably make use of the jar command lin as suggested in @Alan's answer.




回答3:


To extract the contents of a JAR file to see what’s inside, change the extension of the JAR from .jar to .zip. Then you can extract the files with whatever zip extraction tool you choose.



来源:https://stackoverflow.com/questions/46616520/list-modules-in-jar-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!