samsamara
samsamara

Reputation: 4750

Eclipse ctrl+click refers to wrong line

I have been facing this problem that when I ctrl+click on a method name to go inside that method, it points me somewhere else. Closing the editor and reopening doesn't fix the issue, I have to restart the eclipse which is so frustrating. Does anyone know why it's happening so and the fix to it?

eclipse version: 4.5.0

os: ubuntun 14.04

Upvotes: 0

Views: 263

Answers (3)

Manprit Singh
Manprit Singh

Reputation: 31

Depending upon your Eclipse version : Goto Project Explorer > Your Source Directory > Right Click > Index > Rebuild.

Upvotes: 0

Ramraj
Ramraj

Reputation: 2160

Sometimes I face this issue but will get fixed if eclipse is relaunched. Anyway, try this.

Clean-build the workspace:

  1. Save all your files in the workspace.
  2. Project -> clean -> 'Clean selected projects below'
  3. Check your workspace if unchecked
  4. Check 'Start a build immediately' if unchecked and click 'ok'

Now try 'ctrl + click' or F3 in eclipse to goto method definition. Hope it helps!

Upvotes: 0

Sumit Singh
Sumit Singh

Reputation: 15906

Using eclipse Hyperlinking you can open following:

enter image description here

So if it is opening declaration Ex: interface declaration, then try implementation option.

See following for more details:

Upvotes: 1

Related Questions