Sometimes, I get this message in the status bar when I press F3 on a Type in a Java editor:
Current text selection cannot be opened in an editor
When I copy the selection into the clipboard and use Ctrl+Shift+T to open the "Open Type" dialog, I can paste the value and it will display the type and I can open it. The type is on the class path (no compile errors).
In other Java editors in the same project, F3 / Ctrl-Click works.
In the "broken" editor, it only works on internal fields and methods. For internal fields, it only works in the place where the field is defined. All places where a field is used are dead. "Mark Occurrences" works, though.
How do I get rid of it?
So far, I tried:
This happens on Eclipse 3.7.2 with m2e 1.3.1 installed.
[UPDATE] This seems to be a bug somewhere in the depths of m2e and JDT. Usually, it appears when you have several projects (Maven multi module / reactor build) and the modules MA
, MB
and MC
depend on each other:
MC
depends on MB
depends on an inner parameterized type X.Y<T>
of MA
.
and you have closed the module MB
. On the classpath of MC
, this will look like so:
MB.jar
MA
That is MB
exists as a JAR on the classpath while MA
is imported as an Eclipse project from the workspace.
In this situation, Eclipse gets confused when reading .class
files in MB.jar
which need inner parameterized types from MA
. My guess is that it needs the type from MB.jar
, parses it which tells it of the dependency to the type in MA
which it then tries to parse only to find that the type parameter for T
can't be resolved since parsing of MB
isn't finished, yet.
There are three fixes:
MA
. That will import everything as a JAR.MB
.[OLD]
If this happens, try these steps in order of increasing despair:
If all that fails:
.metadata
in your workspace. It's an invisible folder on some OSs but it's there.Related: