Friday, December 5, 2014

How to add or remove classes from a JAR file.

This is for testing purpose. Quick tips on how to add or remove classes from a JAR file.
1. Backup the jar file you want to modify.
2. unzip the jar file into a directory.
unzip xxx.jar -d <directory_name>
3. Go to the directory and add or remove classes.
4. In the directory where MANIFEST.MF exists, recreate the jar file.
jar cfm ../../xxx.jar MANIFEST.MF ../com/

No comments:

Post a Comment

Popular Posts