[java] Eclipse does not highlight matching variables

This is what worked for me (credit to YardenST from another thread): Instead of double clicking file when opening, right click on file -> Open with -> Java editor

Screenshot