Is there a quick way to delete a file from a Jar / war without having to extract the jar and recreate it?

后端 未结 3 1562
感情败类
感情败类 2020-12-02 07:38

So I need to remove a file from a jar / war file. I was hoping there was something like \"jar -d myjar.jar file_I_donot_need.txt\"

But right now the only way I can

3条回答
  •  [愿得一人]
    2020-12-02 07:57

    zip -d file.jar unwanted_file.txt
    

    jar is just a zip file after all. Definitely much faster than uncompressing/recompressing.

提交回复
热议问题