Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a java diff tool?

 
Mike Fourier
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic