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/

1 comment:

  1. Thanks for sharing this useful tutorial! The step-by-step explanation for adding or removing classes from a JAR file is clear and practical, making it a valuable resource for Java developers working with archives and application updates.

    penny pincher

    ReplyDelete

Popular Posts