Eclipse f3 not opening declaration
Asked Answered
E

12

7

I have Eclipse (Mars) web development tools installed on a MacBook Air. Recently, hitting f3 stopped opening the declaration.

The key mapping in Eclipse (Mars) - web development tools:

enter image description here

In another Eclipse install (Luna) - Android development tools, where the f3 function is working, the key mapping is:

enter image description here

What is wrong with the Mars version? What do I need to add to get it to work in the Java editor?

I have seen this post, but I don't have the exact same issue. Nothing happens when I hit f3.

Additionally

Other short cut keys work.

Opening the declaration with the context menu does work.

But there is no key short cut listed in the context menu.

enter image description here

Did this key mapping change with Mars? In my Luna verion, the context menu has the key map listed:

enter image description here

Enjambement answered 5/8, 2015 at 16:30 Comment(9)
Is it just F3 or all functions keys?Handal
@Handal - Yes others work - but the mapping is off. Shift+CMD+/ should block comment, but is opening the help menu!!! I have restored defaults, but they remain mapped from what the preferences>key mapping shows. Please see my edit.Enjambement
Are you sure the Java Build Path is valid and that the source file you've opened is in a Java Source Folder?Jointer
@Jointer - Without question yes.Enjambement
Does hyperlinking, with Cmd+Click, still work?Jointer
Where you would hit F3 to go to a declaration, click on the reference like you would in a web page. Just trying to determine whether it's an issue with the Open Declaration functionality and or really is just about key bindings.Jointer
@Jointer - Please see my edits - the context menu is not showing the mapping in Mars as it is in Luna.Enjambement
@Jointer - I did not even know cmd+click was a thing. It does work, as does the context menu open declaration.Enjambement
I had a similar issue (F3 not working for Java source). Just now I found out it was caused by one of the installed plugins. So you might want to uninstall recently installed plugins and see if the problem goes away.Yeaton
A
6

I've the same issue. You can use "Ctrl + Left mouse click" instead.

Autotoxin answered 20/11, 2015 at 8:37 Comment(0)
T
3

Make sure your function lock key is not pressed. I apparently hit mine and didn't notice given that F3 is the only function key I use.

Seems stupid but this literally happened to me and the other suggestion didn't help.

Thermistor answered 4/8, 2017 at 15:26 Comment(0)
Q
2

In eclipse mars goto:

  • window
  • preferences
  • General
  • Keys to open the key mapping view.
  • type 'open declaration' in the filter text.
  • copy one of the commands that are already there Copy Command
  • Enter 'F3' in the Binding.
  • In the drop down menu of the combo box of 'When' select Editing
  • Then whatever Language You Are Using
  • Source
  • Apply
  • and press Ok
Quaquaversal answered 9/12, 2015 at 11:54 Comment(1)
Example of the drop down menu: 'When' select 'Editing Java Source'Fiedler
M
2

I had the same issue after installing Apache Directory Studio.

Go to Window->Preferences, General->Keys. Filter for F3 and you'll see all the different ways that F3 is bound. I got it to work again by disabling F3 in the LDAP windows (i.e. deleting the binding).

Mohan answered 7/12, 2016 at 15:16 Comment(1)
This is exactly what I needed to do. Prior to trying this I tried duplicating an existing F3 'Open Declaration' command and setting the 'When' field to 'Editing Java Source'. The fix suggested here did not work until I also unbound this duplicated binding.Conciliatory
T
0

Some suggestions to try:

  1. Try creating a new workspace, and check if F3 works

  2. Try switching to a different perspective

  3. Try downloading a different eclipse release, maybe the java developers release, check that F3 works, then install whatever you need for web development.

Thiele answered 5/8, 2015 at 18:29 Comment(0)
C
0

Right Click on the project -> Properties -> Project Facets -> Click on the Configuration Link -> Click on Apply Button -> Click on OK button.

The above steps should set your project as a Java project.

Coven answered 12/7, 2017 at 7:39 Comment(0)
F
0

Looking at the comparison of the preferences that work vs what does not work, the issue is clear.

  • Go to: Window/preferences/General/Keys to open the key mapping view.
  • Type 'Open declaration' in the search box
  • Enter 'F3' in the Binding textbox.
  • If you are editing for C++, Java any language, you need to have a specific F3 binding for that language!
  • Example for Java source code select 'Editing Java Source' in the 'When' dropbox.

Apply and press Ok

Fiedler answered 2/11, 2018 at 16:7 Comment(0)
P
0

Solution : 1. Download and install this eclipse

eclipse-jee-2019-12-R-win32-x86_64

F3 shortcut key is worked for java file and Testng.xml.

i am able see package name and class name and also it navigate methods.

Philander answered 7/6, 2020 at 15:1 Comment(0)
M
0

Even I faced the same issue in windows,I was using cucumber and was unable to navigate using F3. I solved by doing the following:

  • Click on Help in Eclipse >
  • Eclipse MarketPlace
  • type "Natural" in search and press enter
  • Install "Natural 0.9" plugin
  • Restart Eclipse

This should work, if not working even after that, uninstall cucumber plugin in Eclipse Marketplace

You will be able to navigate from Gherkins, even after this if you are finding issues do the following:

  • Go to Window ->Preferences, General->Keys > Click on "Restore Defaults"
Martinson answered 22/9, 2020 at 9:54 Comment(0)
S
0

My solution was right clicking on a file and making sure Java Editor was checked:

enter image description here

Shatzer answered 15/11, 2023 at 9:20 Comment(0)
M
0

https://www.eclipse.org/forums/index.php/t/201175/

Thanks to Markus for this answer:

Preferences > C/C++ > Editor > Scalability > "Uncheck" Disable editor live parsing

Meshed answered 31/1, 2024 at 22:57 Comment(0)
P
-1

I had a similar problem today - Unable to open Declarations in Java Editor using F3 or CTRL+Left Click.

Solution :

STEP1: Selected any java file in Eclipse Explorer.

STEP2: Clicked the - sign at the top of the Eclipse explorer. This compressed view of all modules in Eclipse.

STEP3: Right click on the empty space on the Eclipse Java Explorer and chose Refresh Option (F5) .

STPE4 : Happily the navigate options like F3, F2 , CTRL + Right Click all started working.

Prelatism answered 16/1, 2017 at 16:10 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.