Double clicking on a war file in Beyond Compare's folder compare will expand it as a folder because war files are essentially zip files.

To decompile Java class files to source code in Beyond Compare, install the Java Class to Source file format. With the file format installed, when you double click on a .class file inside a .war archive, it will display the decompiled source code in Beyond Compare's Text Compare.

Download page for file formats: http://www.scootersoftware.com/download.php?zz=kb_moreformatsv4

Note the Java class to source file format is only available for Windows, it isn't available for the Linux or Mac versions of Beyond Compare.

Answer from Chris Kennedy on Stack Overflow
๐ŸŒ
TextCompare
textcompare.org โ€บ java
Online Java Compare Tool
Just click Compare button to view side by side comparison. View the differences highlighted in colors. Privacy: This tool does all the processing on your browser, so nothing is saved on our server unless you choose to save.
People also ask

How can I Compare CLASS (java class file)?
First, you need to add a file for Comparison: drag & drop your CLASS file or click inside the white area for choose a file. Then click the "Compare" button. It will now allow you to Download your CLASS file.
๐ŸŒ
fileproinfo.com
fileproinfo.com โ€บ home
Compare CLASS Files Online & Free - FileProInfo
What browser should I use to Compare CLASS?
You can use any modern browser to Compare CLASS, for example, Google Chrome, Firefox, Opera, Safari.
๐ŸŒ
fileproinfo.com
fileproinfo.com โ€บ home
Compare CLASS Files Online & Free - FileProInfo
How long does it take to Compare CLASS?
This Comparer works fast. You can Compare CLASS in a few seconds.
๐ŸŒ
fileproinfo.com
fileproinfo.com โ€บ home
Compare CLASS Files Online & Free - FileProInfo
Top answer
1 of 3
11

I have spent the day writing a DLL plugin for Winmerge to do this - it isn't the world's greatest thing, but it gets the job done.

Takes the filename, splits it into directory and class name, then calls javap for each class file. It is rather slow unfortunately (javap's fault I'd say).

It would be nice if winmerge compared the files before unpacking them to see if they are different - that would save a bit of time. Maybe this can be accomplished in the plugin somehow but as I said I really just hacked this together as quick as I could.

Source, prebuilt DLL, and instructions here: https://gitlab.com/wayneuroda/winmerge-unpack-java-class-files

2 of 3
1

If comparing disassembled JVM bytecode (see my other answer) is not enough, maybe decompiling to Java source code might be more helpfulโ€ฆ

After learning about the "currently undocumented" Plugins.xml (Plugins in the improved plugin system) as an alternative to sct and dll plugins, I have sucessfully "created" a plugin decompiling Java *.class files using procyon Java Decompiler in WinMerge 2.16.30.0:

  1. Create directory %APPDATA%\WinMerge\MergePlugins, if it doesn't exist.
  2. Create file %APPDATA%\WinMerge\MergePlugins\Plugins.xml, if it doesn't exist.
    • Use C:\Program Files\WinMerge\MergePlugins\Plugins.xml as template removing <plugin> elements.
  3. Insert a custom <plugin> with your path\to\procyon-decompiler.jar:
<?xml version="1.0"?>
<plugins>
  <plugin name="MyDecompileJavaClass">
    <event value="FILE_PACK_UNPACK" />
    <description value="My JVM class decompiler with Procyon. &#xD;&#xA;Arguments: Command line options passed to the java command." />
    <file-filters value="\.class$" />
    <is-automatic value="false" />
    <unpacked-file-extension value=".class.java" />
    <extended-properties value="ProcessType=Decompilation;MenuCaption=My Decompile Java Class" />
    <arguments value="A:\path\to\procyon-decompiler.jar" />
    <unpack-file>
      <command>cmd /c java -jar ${*} "${SRC_FILE}" > "${DST_FILE}"</command>
    </unpack-file>
  </plugin>
</plugins>
  1. Reload plugins (WinMerge menu command).
  2. If necessary, adjust the path to Procyon JAR (arguments) in WinMerge plugin settings.
  3. Use the new plugin for unpacking/comparing in WinMerge.
๐ŸŒ
GitHub
github.com โ€บ GraxCode โ€บ cafecompare
GitHub - loerting/cafecompare: Java code comparison tool (jar / class)
Cafecompare is a GUI application for analysis and comparison of java archives and class files. Similar to github commits the file diffs are highlighted. Also works with obfuscated code.
Starred by 341 users
Forked by 38 users
Languages ย  Java 99.7% | HTML 0.3%
๐ŸŒ
FileProInfo
fileproinfo.com โ€บ home
Compare CLASS Files Online & Free - FileProInfo
April 25, 2022 - Open free CLASS compare online tools & apps that does not required any registrations and installations on your system, use from any device with a modern browser like Chrome, Opera and Firefox.
๐ŸŒ
Narkive
comp.lang.java.help.narkive.com โ€บ Ngy1sk98 โ€บ possible-to-compare-class-files-generated-by-different-java-compilers
Possible to compare .class files generated by different java compilers?
I would do something like: javap ... ClassFile1.disasm. Do this for the developers binaries and then for your binaries. Finally, use a text diff tool to compare the two text files....
Find elsewhere
๐ŸŒ
JDriven Blog
blog.jdriven.com โ€บ 2012 โ€บ 12 โ€บ compare-jar-files-class-content
Compare JAR files content; decompiling class files - JDriven Blog
December 17, 2012 - If you ever need to compare JAR, WAR or EAR files and need to compare the Class files inside; don't try to unpack to a folder, decompile to a different folder and finally folder compare. You should use Beyond Compare and save time on comparing.
๐ŸŒ
OV DSS
ovdss.com โ€บ home โ€บ compare data โ€บ compare java code online -๐Ÿ”ฅ fast & free tool
Compare Java Code Online -๐Ÿ”ฅ Fast & Free tool
With Compare Java Code Online, you can quickly discern the contrasting output messages and structural disparities between two Java programs.
๐ŸŒ
Diffchecker
diffchecker.com
Compare text and find differences online or offline - Diffchecker
Compare text, files, and code (e.g. json, xml) to find differences with Diffchecker online for free! Use our desktop app for private, offline diffs.
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ comparing two jar files in java
Comparing Two JAR Files in Java | Baeldung
April 20, 2024 - Then letโ€™s use the pkgdiff command to compare the sample JAR files: ... The report shows changes in our binary. It shows the percentage changes in class files. Furthermore, it summarizes the binary. It shows the number of added and removed files.
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 206987655-How-to-compare-2-classes-with-the-diff-tool
How to compare 2 classes, with the diff tool? โ€“ IDEs Support (IntelliJ Platform) | JetBrains
There are 3 ways: 1. Select two files in Project View or Commander the select Compare/Merge | Compare Files from context menu. 2. Open one file in editor and select a file in Project View/Commander then use Compare/Merge | Merge File with Editor ...
๐ŸŒ
Diffchecker
diffchecker.com โ€บ eJfYL8YP
Diff for Method.java
Diff for Method.java - Class expected = com.ibm.jit.JITHelpers.getExpectedException();
๐ŸŒ
Java Decompilers
javadecompilers.com
Java decompiler online
Java decompilers online: *JAD, *JDCore, *Procyon, *Fernflower, *CFR. โœ“ A user interface to extract source code from .class and .jar โ€˜binaryโ€™ files.
๐ŸŒ
Text-comparer
text-comparer.com โ€บ java
Online Java Code Compare Tool
Text Comparer lets you easily compare texts, highlight differences, view syntax for programming languages, and share results. Ideal for developers and writers.
๐ŸŒ
Java Decompiler
java-decompiler.github.io
Java Decompiler
JD-GUI allows you to browse the CLASS files and Java modules hierarchy.