Search This Blog

Total Pageviews

How to update a resource file in a .jar file

The Jar tool in version 1.2 of the JavaTM Development Kit provides a u option which you can use to update the contents of an existing JAR file by modifying its manifest or by adding files.
The basic command for adding files has this format:
jar uf jar-file resource-file(s)
In this command:
  • The u option indicates that you want to update an existing JAR file.
  • The f option indicates that the JAR file to update is specified on the command line. If the f option is not present the Jar tool will expect a JAR filename on stdin.
  • jar-file is the existing JAR file that's to be updated.
  • resource-file(s) is a space-deliminated list of one or more files that you want to add to the Jar file.
Eg:   jar uf test.jar resource.xml  ( If resource.xml exists, it will overwrite, if not it will add to the jar file).

To update manifest file:
              jar umf manifest_file jar_file.

No comments:

MongoDB Tutorial MongoDB Tutorial Table of Contents Introduction to MongoDB Installation Creating a Database Creati...