Jarcomp is a comparison tool for Jar files and Zip files. It's free and cross-platform.
If you have two jar files or two zip files, it will show you what the differences are in the contents. It shows which files have been added, which have been removed, and which are present in both archives. If a file is found in both, it will tell you whether the file has grown bigger or been reduced in size, or if it's the same size in both. If it's the same size, an md5 checksum can be made for both files to see whether they're really the same contents or just the same size.
It can be useful to compare different versions of the same archive, for example to check that no files were accidentally added or forgotten, and that all the changes to the files are the ones intended.
This tool is based on java, so you'll need a java runtime (at least version 5) in order to run it.
The screenshot to the right shows an example of comparing two jar files. The two files (in this case releases of GpsPrune) are summarized at the top, showing the file sizes in bytes and the number of files within each one. Below this the comparison is summarized, saying whether the files have the same size or not, and whether the contents are the same or not. Note that it's possible for two jars to have the same size but different contents, and also to have different sizes but identical contents.
In the table, each file is shown and the status of whether the file has changed or not between the two archives. Files may have been added or removed, or be present in both files. Files may have changed size, in which case the size change in bytes is shown in the third column of the table.
In this example, the file GpsPrune.class has the same size in both files, but nevertheless the files are different - this was deduced by pressing the "Check Md5 sums" button to calculate all the Md5 checksums of the files within each archive. Therefore for these two files the status is not "=" (meaning identical), but "Changed sum", indicating that the size is the same but the contents are not identical.
Runnable code plus source code (44 kb)
Before you run it, download the jar file above and save it to your machine.
This checker tool runs using a standard java gui. Depending on your system settings, you should be able to just double click the jar file to run it, or right-click and select to run it. Then the tool will prompt for the two files to compare.
You can also run it from the command line, just by giving the path to the jarcomp.jar file:
java -jar jarcomp_02.jar
Or you can also give it the two files to compare straight away:
java -jar jarcomp_02.jar file1.jar file2.jar
Version 1 remained stable and unchanged for many many years, but an alert user noticed a bug in the file selection dialogs (thanks, Greg!). And so while fixing that, the opportunity was taken to revisit the old code, add some yellow row highlighting for the changed files, and finally fix the sorting for the third column. There are also now tooltips added to the "Path" labels, in case the paths are too long to fit on the screen, and a few extra pixels around the summary labels to space them away from the window border.
It's a bit of a shame that all the GUI elements are still only available in English, but as long as there's not a burning desire to have it in other languages then I guess it'll stay like that.