How do you extract a JAR in a UNIX filesystem with a single command and specify its target directory using the JAR command?

前端 未结 4 666
囚心锁ツ
囚心锁ツ 2020-12-23 16:34

I am creating a Python script within which I am executing UNIX system commands. I have a war archive named Binaries.war which is within an ear archive named Portal.ear

4条回答
  •  温柔的废话
    2020-12-23 16:52

    I don't think the jar tool supports this natively, but you can just unzip a JAR file with "unzip" and specify the output directory with that with the "-d" option, so something like:

    $ unzip -d /home/foo/bar/baz /home/foo/bar/Portal.ear Binaries.war
    

提交回复
热议问题