4

I'm using Beyond Compare 4 (4.1.9) in order to compare war files.

I need to compare the files .class that I find in the several packages.

  1. How I can compare them using this product (Beyond Compare 4)?
  2. Otherwise there is another product which can compare war file and compile the .class files?
diyoda_
  • 4,980
  • 7
  • 50
  • 88
pacio14
  • 261
  • 1
  • 6
  • 16

3 Answers3

9

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.

Chris Kennedy
  • 2,101
  • 9
  • 8
1
  1. Download Java Class to Source file format from http://www.scootersoftware.com/download.php?zz=kb_moreformatsv4

  2. In Beyond Compare, pick Tools | Import Settings.

  3. Fill in the downloaded filename, and click Next and proceed to finish.

ChandraBhan Singh
  • 2,363
  • 18
  • 26
0

I recently came across the need to compare class files in Beyond Compare 4 and so I found that adding an external program and using javap -l -p -c -constants %s > %t 2>&1 was enough for me. Just make sure a reasonably recent javap is one the PATH that understands any of the class file formats you'd want to compare. No extra software required and is cross platform compatible.

Ray
  • 1,237
  • 9
  • 16