I often need to compare two files to see their differences.
The UNIX geek in me is using diff --side-by-side for that. But sometimes I want something more fancier with bright colors and easier to scroll.
Eclipse provides a handy feature to compare two unrelated files (e.g. not two CVS revisions of the same file) but it’s quite difficult to find it first.
To compare two files in Eclipse, select both files (Control click them) and in the contextual menu (right button), chose Compare With > Each Other. Et voila! you got a nicer diff than its CLI counterpart.

March 20th, 2005 at 23:05
You is da man Jeff. That is exactly what I was looking for.
Please post any other Eclipse tips you have !
Zafar, An-Eclipse-Beginner
March 21st, 2005 at 20:59
Zafar,
Are you the anonomous person who left the message saying thanks about finding the eclipse thingie.
Anon…
July 17th, 2006 at 11:08
Thx man! I almost started manually merging files together, but you saved me couple of minutes!
September 6th, 2006 at 21:02
Thanks a bunch! That was exactly what I was looking for!!!
-Brian
October 19th, 2006 at 23:44
Hey do you know of a way to generate a diff file while comparing two unrelated files? I can generate a diff file while comparing two revisions of the same file but I would like to auto-merge changes from one file into another. Thanks.
October 20th, 2006 at 17:16
Ken, I don’t know how to generate a diff file from Eclipse using the “Compare with each other” command.
However, you can still use the Compare editor to copy the changes from one file to another using the buttons of the Compare editor.
February 26th, 2007 at 23:53
Thanks Man, I’ve been looking for a diff plugin for ages but it looks like it was right there in front of me the whole time !
April 23rd, 2007 at 17:34
You can also use this to compare two directories!!! Then you can drill down into each file to see the difference. Just select both files in Navigator right-click one and then compare
May 8th, 2007 at 0:11
Hello,
How to programatically do this in Eclipse? I want to compare 2 files and assert whether
they are same or not?
Literally, the code behind this comparison editor in eclipse i guess.
Thanks,
Rama
July 3rd, 2007 at 16:55
Today I’ve tried to compare 2 files with size about 300K each. Eclipse’ve ate all free memory in my laptop (1.5 G RAM), hang itself for 3 minutes and only after that showed compare editor… So as I can see implementation of “compare to each other” very staight-forward and works very bad.
Any way thanks for the tip! For people who don’t have Araxi Merge this solution better than nothing.