Patching a Java Library
If you find yourself decompiling a Java class to fix a bug or insert some debugging statements, you might have to insert the class back into the original library. The obvious solution is to unpack the library, copy the class where it belongs, and then use JAR to recreate the library.
Occasionally, the new library doesn't work correctly. Sometimes the process of unpacking and repacking the JAR can lose some information—you might forget a directory, or you might need to force JAR to include the manifest file again. In these situations, it's better to use a ZIP program such as Info-ZIP or WinZIP to update the existing JAR file (after you make a backup copy of the original JAR file!). Because JAR files and ZIP files share ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access