Eclipse does not highlight matching variables for me:
I\'ve already tr
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.
Alt + Shift + o
will solve your problem and agree with @Korhan Ozturk as well :)
Sometimes problems in your project build path
can cause this, make sure you resolve it first, in my case the prolem was :
And when fix it highlights come back.
There is a bug in Eclipse Juno (and probably others) but I have a workaround!
If you have already checked all the configurations mentioned in the top answers here and it's STILL not working try this.
To confirm the problem:
If this is happening for you, you must close ALL of your open files and reopen them. This bug seems to also make weird things happen with Ctrl+S saving of an individual file. My guess is that something is happening whereby internally eclipse believes a certain file has focus but it actually doesn't, and the UI's state is rendered as though a different file is being edited.
Edit: If it's STILL not working, you might need to restart eclipse, but if you don't want to, try selecting the item you want to see occurrences of then disable and re-enable the Mark Occurences Toggle button.
.
Java - Editor - Mark Occurrences
Eclipse Java EE IDE for Web Developers. Version: Photon Release (4.8.0)
I wish I could have read the response by @Ján Lazár.
In addition to all the configurations mentioned in the accepted answer, below setting solved my misery:
For large files the scalability mode must be turned off. Enabling scalability mode will disable reference highlighting.
PS: @Rob Hruska It would be great if this point is added in the accepted answer. Most of the readers do not bother to read the last response.