background
It is inevitable to compare the source code of two jar/class/war files when the version is confused during project maintenance or when going out to troubleshoot on-site projects.
Usually, we use jd-gui to directly drag the file into the comparison at this time, which is only suitable for the comparison of a single file.
If there are many jar or class files in a lib directory to be compared, the workload is relatively large at this time.
At this time last year, the author did some research on the Internet and found a middleware that can be decompiled in batches. Later, I wrote an article CFR - another java decompiler to decompile jar files in batches .
This can be decompiled in batches, see that article for details. Under the background of the above work, the author has sorted out a batch of
Compare the plugin of beyond comapre of java bytecode, as shown in the following figure
The usage is very simple, just select two class/jar/war to compare.
Instructions
Download the attachment in this article and double-click the configuration file to import it.
other
The author has common sense to attach the jar in the maven repository to the java -classpath path, and the "input line is too long" error is displayed. If you have a way to open the below compare installation directory
Edit CLASS_to_JAVA_cfr.bat or related batch file in Helpers\Java directory.
CLASS_to_JAVA_cfr.bat
@echo off java -classpath Helpers\Java\cfr\cfr_0_128.jar%jarFiles% org.benf.cfr.reader.Main %1 --caseinsensitivefs true > %2
javaDevEnv.bat
@echo off setlocal ENABLEDELAYEDEXPANSION set jarFiles= for /F %%i in (cfr\cp.txt) do ( set jarFiles=!jarFiles!;%%i) echo %jarFiles%
setclasspath.bat
@echo off color 17 title is generating the class environment variable file dir /s /b /d D:\develop\apache-maven-3.5.3\repo\*.jar > "%cd%\cp.txt" title The environment variable file has been generated ....