Comparing files

31 December 2007

While working on projects, sometimes you wish to see the changes you made since last version of the file. This is important to rollback changes or simple to know what new has been added or what has been removed. Eclipse provides a useful feature for this very purpose. In this post, I will write about compare feature.

Whenever you save a Java file, Eclipse keep a copy of the older one if this feature is enabled. This is required for comparing files in case you need that. To view the history of a Java class, simply right click the file and click Show in > History. You will be shown all the revision times of the Java class.

History of changes

To compare the current Java class with some old version, right click the class and choose Compare with > Local history. Now you have to choose the version of the file with which you want to compare. After choosing, you will be shown both files in a window like this:

changes made

The added code will be highlighted. You make rollback the changes if you want.

Comparing files is a simple but useful feature provided by Eclipse. Explore it and use it when needed.

del.icio.us:Comparing files  digg:Comparing files  spurl:Comparing files  wists:Comparing files  simpy:Comparing files  newsvine:Comparing files  blinklist:Comparing files  furl:Comparing files  reddit:Comparing files  fark:Comparing files  blogmarks:Comparing files  Y!:Comparing files  smarking:Comparing files  magnolia:Comparing files  segnalo:Comparing files  gifttagging:Comparing files

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Comparing files

Leave a Reply