It's not a secret anymore!
The moose likes IDEs, Version Control and other tools and the fly likes Is there a java diff tool? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Is there a java diff tool? " Watch "Is there a java diff tool? " New topic

Is there a java diff tool?

Mike Fourier

Joined: Apr 02, 2008
Posts: 25
My scenario is this:

I've inherited a production application that is running as an unexploded war file. The size of it, is 6,790k.

On the same server, different folder, I have the war file at 6,998k.

Finally, building HEAD produces a war file of 6,787k.

I'm not so much concerned with WAR #2. I need to know what is in that 'production' version of th WAR, or rather, how it differs from what HEAD contains.

Is there a tool that I can run against class files that does a 'diff'? I know I can use a tool like WinMerge to diff whole directories of text files (such as JSP, CSS, XML, etc). I'm platform agnostic, any tool will do.

I suppose I could just decompile all classes down to *.java, and then diff those. Was hoping to avoid it.
Vilmantas Baranauskas
Ranch Hand

Joined: Dec 20, 2006
Posts: 89
The difference in size is quite small. Hopefully there are only minor differences.

On linux/unix, I would unpack both files and then do diff -r extracted_old extracted_new.

This would give me idea which files are added/missing/different. Then you could check different files manually.

If all *.class files are different, then this might result in you using different version of JDK.

Author of <a href="" target="_blank" rel="nofollow">NewsInjector</a>
I agree. Here's the link:
subject: Is there a java diff tool?
It's not a secret anymore!