Modifying a jar file

后端 未结 5 1158
轮回少年
轮回少年 2020-12-30 09:47

I have a jar file which is used in html file as applet. I want to modify the content of the jar file and to rebuild the jar file so that the html will work fine with the new

5条回答
  •  心在旅途
    2020-12-30 10:37

    This is surely possible from the command line. Use the u option for jar

    From the Java Tutorials:

    jar uf jar-file input-file(s)
    

    "Any files already in the archive having the same pathname as a file being added will be overwritten."

    See Updating a JAR File

    A brief test shows this quickly updates changes apart from trying to delete the file.

    I haven't seen this answer on other threads about modifying jar files, and many, marked as duplicates, suggest there is no alternative but to remake the jar completely. Please correct if wrong.

提交回复
热议问题