92

If I'm in an interface and pointing to a method name, what can I do to quickly go to the ONLY implementation of that method?

Using Eclipse 3.6.

4 Answers 4

129

F3 is the typical "go to implementation". For interfaces that go to the interface definition.

Instead use Ctrl + T to see all implementations of the interface definition. You can then easily go to the one you want with the arrow keys and Enter. I believe that the first one is automatically selected so that Ctrl-T + Enter will do what you need.

4
  • 1
    Ctrl-T + Enter doesn't work in my case. The default focus is the filter text box. Thus, this combined keys just opens the interface.
    – Loc Phan
    May 26, 2016 at 2:20
  • 2
    @TheSea Ctrl-T + Arrow down + Enter perhaps then? Jan 12, 2017 at 11:40
  • 3
    Yes. However, Arrow down + Enter is pretty expensive when we are reading code. Especially, after pressing Ctrl + T, Eclipse search all the implementations in the workspace which causes some unpredictable delay :)
    – Loc Phan
    Jan 13, 2017 at 3:12
  • 1
    @TheSea I have since switched to IntelliJ which does this much much better. Jan 13, 2017 at 6:55
89

I just checked this on my Eclipse 3.6 install: Hold control (command on Mac), hover over the method name and select "Open Implementation".

You may assign a keyboard shortcut to this action by using Window > Preferences > General > Keys and searching for "Open Implementation".

3
  • 1
    You might also want to change that key binding's scope ('When') to 'Editing Java Source` or something. Aug 1, 2017 at 15:44
  • This works perfectly fine unless u have to be switching between machines that are used by several users...RIP no mouse users...
    – dbl
    Jul 21, 2020 at 12:50
  • this will save me a lot of clicks ! thanks for sharing !
    – mounaim
    May 27, 2022 at 13:53
25

In the keymap (General > Keys) search for "open implementation" and map it to whatever you want. I chose Ctrl + Shift + I. Make sure you select "Editing Java Source" in the When box. I tested it, and having the cursor over the method name and pressing Ctrl + Shift + I took me directly to the implementation instead of showing the hierarchy that you get with Ctrl + T.

enter image description here

Also you can see an answer to a nearly identical question for other options:

2
  • 1
    Note that we can actually keep the original F3 key rather than having to invent some extra nonstandard key: if we assign F3 to "Open implementation" with "When = Editing Java Source", there is no conflict with the original F3 "Open declaration" with "When = In Windows" Feb 5, 2019 at 15:53
  • Further note: "Ctrl + Shift + I" is already taken by the debugger's Inspect expression command. Feb 5, 2019 at 16:25
0

If someone still need this information nowadays (Eclipse version 2022), to jump into interface method definition starting from an @Override method, now in Eclipse you can see on the left, next to the method signature, a little white triangle. By clicking on that you will jump to the implemented interface method. here an image of the little triangle

Oterwise, if you are on a interface method definition and you need to jump to one of the implementations, you must use CTRL+T shortcut to see the list of available implementations and than click on one of them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.