To compare two files in Eclipse, first select them in the Project Explorer / Package Explorer / Navigator with control-click. Now right-click on one of the files, and the following context menu will appear. Select Compare With / Each Other.

To compare two files in Eclipse, first select them in the Project Explorer / Package Explorer / Navigator with control-click. Now right-click on one of the files, and the following context menu will appear. Select Compare With / Each Other.

Just select all of the files you want to compare, then open the context menu (Right-Click on the file) and choose Compare With, Then select each other..
Videos
i really like the AnyEdit Plugin (http://andrei.gmxhome.de/anyedit/). It provides some adittional "Compare With" Functions:
Compare / Replace with Clipboard Editors, Navigator, Project Explorer If some text is selected in editor, then only this selection will be compared, otherwise entire editor
Compare / Replace with Workspace File... Editors, Navigator, Project Explorer If some text is selected in editor, then only this selection will be compared, otherwise entire editor
Compare / Replace with External File... Editors, Navigator, Project Explorer If some text is selected in editor, then only this selection will be compared, otherwise entire editor
Compare / Replace with Opened Editor...
Works very good to me.
Something better:
If you work with (and modify) the same source code base in different workspaces, I'd rather create one workspace containing both projects as well as the shared code. Then use working sets to switch between your different projects. In my opinion everything else is a recipe for disaster. Using this approach you can easily use eclipse's built-in compare features.
I'm using Eclipse Kepler, so depending on your version your mileage may vary.
To compare two methods in the same class, do the following:
- Open the class.
- Show the Outline view (Window->Show View->Outline)
- Hold CTRL and click on the two methods you wish to compare.
- Right click on one of the highlighted methods.
- Click on "Compare With->Each Other By Member"
You'll get a diff window similar to if you were comparing two files.
Update
Since answering this question, I have found a similar, but more powerful way to do this. Follow the steps above, except use the "Package Explorer" view rather than the outline view. The advantage of this is that you can choose to compare two methods that are in the same class or compare two methods that are in different classes. It's a great way to prove that two methods or subclasses are identical and can be refactored into a common shared resource.
May be you can put the two methods in different class file, and put them in Eclipse together. Then simply select them in the navigator or package explorer, right click, and click 'Compare with Each Other'.
Or you can check this question: Diff two methods in eclipse