Updating file in a jar throws ZipException

后端 未结 3 554
小蘑菇
小蘑菇 2021-01-18 00:13

I\'m trying to update a file in an existing jar (in this example antlr) using the command:

jar -uf antlrworks-1.2.3.jar org/antlr/codegen/templates/Java/Java         


        
3条回答
  •  我在风中等你
    2021-01-18 00:53

    If you're on OS X, try the Jar Inspector application. I used it to patch a javascript bug in wicket. You can open a jar file, and it lists all the contents. Navigate to the file you want to save (in this case, a .js file) and modify the file, then save the contents, and it takes care of modifying the .jar file for you. Not sure if this would work with .java files or not.

提交回复
热议问题