This post shows how to patch an existing Java Archive (JAR) to add new functionality to it or change its behavior. This for example can be helpful to add some logging for debugging purposes.
$ jar uvf theJarFile.jar ./com/example/etc/ModifiedJava*
Now it is possible to see the new logging stuff or whatever you did to the Java class. Be aware that this might cause severe problems or side effects in case someone else is depending on this file. ;-)
The following snippet helps to find a particular class file within a big junk of JAR files. This might help if you want to scan a local Maven repository.
find . -name *.jar | while read jarName; do echo "JAR: " $jarName; jar tf $jarName; done | grep "JAR:\|TheJavaFileIAmLookingFor.class" --color=always
Date published: 2013-02-07
Date modified: 2013-02-07
Keywords: Trench, Eclipse, JAR, Java, Patch