List modules in jar file

后端 未结 3 1661
后悔当初
后悔当初 2021-02-07 09:02

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 wo

相关标签:
3条回答
  • 2021-02-07 09:33

    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.

    0 讨论(0)
  • 2021-02-07 09:40

    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.

    0 讨论(0)
  • 2021-02-07 09:49

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

    jar --file=myjar.jar --describe-module
    
    0 讨论(0)
提交回复
热议问题