Jar Compare (free for personal use)

Jar Compare is a tool for Java developers and build engineers. It allows comparing of classes inside Java JAR archives and displaying specific differences in class files
The tool performs deep comparison - it decompiles the class files and displays differences in specific code lines

Jar Compare is useful for:

  • Determining if there were any changes between software releases or builds -- without having to store source code for every release
  • Tracking changes in 3rd party jars your software is using

    Usage: java -classpath jarc [-d"full_path_to_diff"] left.jar right.jar

    Usage: java -jar jarc.zip [-d"full_path_to_diff"] left.jar right.jar

    Options:
    -d specify the diff command to use, e.g.
    -d"diff -y --suppress-common-lines" or -d"somediff $1 $2 -xyz"
    (.zip files ok, too)

    Sample Output

    sample.xml

    Diff between rt.jar in Sun JDK 1.4.2_04 and 1.5.0_07


    Q&A

    Q: How does it differ from zdiff and other archive comparison programs?
    A: Jar Compare knows it deals with Java class files and can show differences in source lines. It compares decompiled Java classes files. Note that the same Java source file compiled twice results in two DIFFERENT Java class files, since there is a unique timestamp embedded in the file

    Q: Why compare classes if you always have sources?
    A: Not always. For example you may have two versions of a 3rd party jar, one works with your code, the other does not. Also, many companies only archive binary builds. It is possible to rertieve source from your version control system, but it may be easier to just compare jars

    Q: Is it written in pure Java?
    A: It is. But it is also using external diff tool of your choice

    Q: What JDK version does it require?
    A: Sun JDK 1.4.2 or better

    Q: Can it work with a JRE?
    A: No, it depends on tools.jar, so full JDK is needed

    Q: Why am I getting "Could not find tools.jar, this needs to be running under a JDK, not JRE" and how to fix it?
    A: The program uses tools.jar provided as part of JDK, but not JRE. If you have JDK installed, please set your path environment varible so that Java executable from JDK directory is executed

    Q: Can I download it and what does it cost?
    A: See the download link below. The product is free for personal use and requires a license for corporate use. A license costs $125 per server/desktop. You will receive a license certificate after payment


    Download Jar Compare 1.1 now!

    Recommended tools: Eclipse Plugins