Eclipse does not highlight matching variables

Eclipse does not highlight matching variables for me:

enter image description here

I've already tried to change "Mark occurrences" via

Window -> Preferences -> Java -> Editor -> Mark Occurrences

but it didn't work. I am not sure why this is not working while others have been able to fix the problem.

Can anyone tell me how can I set highlighting matching variables?

Looking for same variables with my eyes really bothering me too much.


Solution 1:

Try:

window > preferences > java > editor > mark occurrences 

Select all options available there.

Also go to:

Preferences > General > Editors > Text Editors > Annotations

Compare the settings for 'Occurrences' and 'Write Occurrences'

Make sure that you don't have the 'Text as higlighted' option checked for one of them.

This should fix it.

Solution 2:

Alt + Shift + o
Will solve your problem and agree with @Korhan Ozturk as well :)

This is known as Toggle Mark occurrence (Alt + Shift + O), Means will highlight all occurrence of focused variable. Same thing can be achieved from tool bar as follows

enter image description here

In same tool bar there is another switch if you turn that on you will see complete path for opened file, That is Breadcrumb enter image description here

there are some more very useful switches like word wrap, Show white Characters just after toggle mark occurrence