Navigating between occurrences

Eclipse can highlight occurrences of the selected variable / field / method, making it a lot easier to read existing code:

Mark Occurences

You can configure this under Preferences > Java > Editor > Mark Occurrences and change the highlighting style under General > Editors > Text Editors > Annotations. I like to enable the annotations in the vertical ruler, because they are easier to spot.

If you want to jump from one occurrence to the next one, you can choose Occurrences in the navigation toolbar and navigate using Ctrl + . and Shift + Ctrl + .

Navigate Occurrences

A bit more convenient is Search > Occurrence in File (Ctrl + Shift + U) which shows all occurrences in a separate view:

Search Occurrences

Ralf Ebert

Ralf Ebert is an independent software developer, technical writer and trainer. He makes apps for Mac OS X and iOS and builds software solutions for companies using Eclipse RCP and Ruby on Rails. He offers training courses for software developers and writes books and articles about software development.