Search code examples
eclipsests-springsourcetoolsuiteeclipse-jdt

Mark Occurrences for binary files in STS


I have created a project using maven in Spring STS. I opened a source file(class file which is downloaded by maven automatically) and placed cursor on methods/variables those occurrences not highlighted in class. How can I fix that?


Solution

  • This is complicated and it is not a maven or an STS bug. Rather, it is a Eclipse JDT bug. Mark occurrences cannot work unless the class file and all of its dependencies can be classloaded using the current project's classpath. So, there must be some dependency that is missing for the class in question. It is probably available at runtime through maven, but just not at edit time.

    It is very tricky to fix this problem, but you can start by explicitly adding all transitive dependencies to your pom.xml.