Accepted answer

there's a little "highlighter" icon on the toolbar - it toggles "mark occurrences".

from the preferences window, the feature you mean is configured by navigating to:

window -> preferences -> java -> editor -> mark occurrences

screen shot


to me it didn't work anymore because there was an error in the code. it generally works, but sometimes it might not, make sure your code has no errors if nothing else works.


i had a similar problem. i solved it by uninstalling the erlang plugin called "erlide".


i had the similar problem where the references were not highlighted, on enabling the mark occurrences in windows-prefrences-java-editor i am able to highlight the references


that is probably how the 'mark occurences' got turned off... i was using ctrl+shift+o to organize imports and by mistake chosen alt instead of ctrl. so it can be turned on again by alt+shift+o.


in addition, you have to go to general->editors->text editors->annotations, choose occurrences and check the "text as" and choose highlighted. this will make you happy.


i had this too and my mark occurrence options were already all checked. as always, try restarting eclipse, it worked for me.

edit: it actually kinda worked. there's a bug on eclipse that when you open a project in a new window (in case your first eclipse window is a mess full of projects) it starts not to work. in case you need you can select an item and toggle the highlighter in the toolbar or use alt+shift+o, but you're gonna have to do it every time you select an item.


on mac os it's opt-cmd-o i pressed that once by mistake, thanks to this question i found my way back


  • in eclipse kepler,
    you can simply use the "toggle mark occurrences" icon on the tool bar or you can use keyboard short cut alt+shift+o.

    enter image description here

  • window > preferences > java > editor > mark occurrences. enable "mark occurrences of the selected element in the current file" and click apply.

    enter image description here


press alt-shift-o.

it toggles the "mark occurrences" feature of eclipse; which provides the highlighting functionality you're missing.


there's a little "highlighter" icon on the toolbar - it toggles "mark occurrences".

you probably accidentally pressed it when trying to select a menu item at some point. i had a friend who did that with the "show selected element only" toolbar button...

you can either press it again or configure as rytmis says.

Related Query

More Query from same tag