How do you recompile a jar file?

后端 未结 4 1084
你的背包
你的背包 2021-01-01 00:28

I took an old jar file and edited it. Now i have a folder that has all the files and I want to recompile them back to a jar file. How do i do this?

4条回答
  •  感情败类
    2021-01-01 01:10

    Jar files aren't "compiled" in the normal sense of the word. But you just create one with the jar command:

    jar cvf myfile.jar file1 file2 etc
    

    You can use globbing as normal:

    jar cvf ../myfile.jar *
    

    Run jar -? or read the docs for more information.

    Note that for an executable jar file, you'll need to specify the manifest file as well.

提交回复
热议问题