Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compare two files in Eclipse?

Tags:

diff

eclipse

I want to compare two files. One is in the current project and the other is in the backup directory. I know how to compare if they were in the same project. How can I compare in Eclipse? And what is Flex navigator in Eclipse?

like image 979
user1301568 Avatar asked Sep 08 '12 21:09

user1301568


People also ask

How to compare external files in Eclipse?

thanks to a tip from john there is another (hidden) way in eclipse to compare external files the trick is described in this article and requires a keyboard shortcut assigned. select the menu window > preferences > general > keys and assign a shortcut key for ‘ compare with other resource ‘:

How to compare two files in a folder?

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.. Share Improve this answer

What is compare with other resource in Eclipse?

This post will focus on another Eclipse feature called Compare with Other Resource that makes things go a bit smoother and handles external files but it will also cover using Compare with Each Other. Although Compare with Other Resource is easier to use, it’s slightly hidden and requires a once-off setup of a keyboard shortcut to work.

How do I compare two files in the navigator?

You can select two or more files in the Navigator using Ctrl-click, or Command-click in OSX. Now Right-click any one of the selected files, and select the menu item: Compare With->Each Other. The problem is that your alternate file might not be in the Navigator, e.g. your backup directory isn't listed in the Navigator.


1 Answers

Open the Navigator with the Main menu: Window->Show View->Navigator.

You can select two or more files in the Navigator using Ctrl-click, or Command-click in OSX. Now Right-click any one of the selected files, and select the menu item: Compare With->Each Other.

The problem is that your alternate file might not be in the Navigator, e.g. your backup directory isn't listed in the Navigator. If not, Right-click in the Navigator and choose the menu item: New->Folder. In the resulting dialog click the Advanced>> button beneath the Folder Name field, choose Link to alternate location (Linked Folder), and browse to add your backup directory.

Now using the Navigator you'll be able to select the two files, and use Compare With.

You can similarly compare files using e.g. the Package Explorer.

like image 173
pb2q Avatar answered Jan 02 '23 09:01

pb2q