22

I'm running Eclipse Kepler, and for some reason, the ctrl-click hyperlink feature isn't working in one particular workspace.

I've looked at this question, and the correct box is checked. The code is compiling cleanly. What else could be causing this behavior? It's a very useful feature, and I'd like it back.

(And this may well be related -- "Mark Occurrences" isn't working in that workspace either, even thought the "Toggle Mark Occurrences" button is pressed.)

F3 gives me a pop-up error: "Problems opening an editor. Reason: [parent-project-of-the-one-that-I'm-in-right-now] does not exist."

Community
  • 1
  • 1
BlairHippo
  • 9,502
  • 10
  • 54
  • 78
  • 1
    Do you see [Current text selection cannot be opened in an editor](http://stackoverflow.com/questions/18227733/how-do-i-get-rid-of-current-text-selection-cannot-be-opened-in-an-editor-in-ec) in the status bar when you Ctrl+Click? Did you try F3? – Aaron Digulla Nov 07 '13 at 16:18
  • I'm not seeing anything in the status bar, but F3 gives me a pop-up error: "Problems opening an editor. Reason: [parent-project-of-the-one-that-I'm-in-right-now] does not exist." – BlairHippo Nov 07 '13 at 16:22
  • What kind of file is it? What kind of project is it in? – nitind Nov 07 '13 at 23:54
  • @nitind: It's a .java file in a Java EE/Maven project. – BlairHippo Nov 08 '13 at 17:43

21 Answers21

38
  1. Close the class you are working on.
  2. Press "Control+Shift+T"
  3. Search with class name
  4. Open the class Now "Ctrl+Click" should work
Jasraj Suthar
  • 423
  • 5
  • 8
  • The ctrl-click usually works for me, but every once in a while it quits working. This was all I had to do to get it to work again. Thanks. – John S Jun 18 '15 at 02:58
  • 1
    Doesn't help for me - Control+Shift+T works but Control-Click doesn't. – mjaggard Jul 21 '15 at 12:43
  • 2
    practical answer. It works for me. It adds indexes to the files. This is the reason may be why it works. – Jatin Sehgal May 26 '16 at 10:16
  • I had a similar issue with Eclipse Oxygen, the Ctrl+Arrows to navigate each word isn't working... – Dudaskank Aug 14 '17 at 15:31
  • this is weird (i.e., absurdly non-intuitive). but it seems to work. – Woodchuck May 07 '19 at 18:03
  • 2
    I had to right click it in the package editor -> open with Java Editor – micahhoover Aug 05 '19 at 19:14
  • @micahhoover Indeed I had this problem: while searching for some references in a multi module maven project: if I click on the references found in the files in the parent project, that is not considered a java project, the file is not oepened in a java editor. In that case it is enough to click on the same hits found in the sub-module that are handled as java projects. – user1708042 Mar 16 '22 at 21:38
  • worked like a chime for me, thank you ! – Jayant Nov 10 '22 at 10:07
6

For further info, click Window > Show View > Error Log. Then see the messages apearing each time you want to do Ctrl+click. Then double-click to open one of the entries and you will get detailed info.

You can cut out come code snippets (for a while), save it and see if the hyperlink functionality restores, then go to another piece of code until you find it.

In my case it occured only in one file and its currently know bug in Eclipse Oxygen: https://bugs.eclipse.org/bugs/show_bug.cgi?id=517610

It occured in PyDdev Just one line of code confused it terribly: Unhandled event loop exception

print '*' * 100, '\n' #  reproduces the bug
print '*' * 100, 'anythin' # also buggy

but

print ('*' * 100), '\n' #  works fine
print '*' * 100 #  works fine
  • This actually helped me to find out what the problem was. In my case it was a plugin which is a XML Editor being loaded for java files. This answer is very helpful because it will show you how you can find out what the problem is. +1 Thanks! – Jorge Campos Jun 07 '18 at 14:23
  • In Eclipse CDT (C/C++ Development Tooling), the "Error logs" view is located on Window > Show View > Other > General > Error Log. – Homaei Mar 11 '20 at 07:59
3

Only solution that I have found was to go into each project and delete the .settings and .project files. Then delete the workspace settings and create all new projects. Had issues with pulling in existing directories when the old project settings still existed.

Seems like a bug in Kepler that a lot of people are running into during the upgrade.

3

This is due to unrechable class folder reference for the source folder. It would be fixed by typing

mvn eclipse:eclipse

Allow maven to complete the build and then refresh eclipse.

2

I just changed the key command to option(alt). Now it works perfectly. Preferences -> General -> Editors -> Text Editors -> Hyperlinking

Oguz
  • 1,867
  • 1
  • 17
  • 24
1

I had the same issue, and solved it the following way. My issue came because I imported a project from Git, which wasn't having the project file. So Eclipse was not recognizing the project as a java one. Ctrl+click was not working and so there was the "F3" issue.

Solution:(not a direct one. but solved my issue)

  • import -> projects from git -> from URI -> select the new project wizard
  • so an empty project with src folder will be created.
  • then copy all the src files in to the folder manually.
1

Here's what worked for me (as of Eclipse CDT Kepler):

In Project Explorer, right-click the file in which Ctrl+Click was not working in Eclipse, and select Index -> Freshen All Files.

That solved the problem of Eclipse not going to / not finding function declaration (via Ctrl+Click or F3).

Roman Kogan
  • 379
  • 2
  • 5
  • 1
    In other versions, e.g. Luna, right-clicking the project or the relevant subdirectory in Project Explorer and then selecting "Refresh" / F5 from the menu may solve the problem. – Ataxias May 07 '18 at 18:48
1

To work around the problem, you can disable the Change Log hyperlink by going to Window > Preferences > General > Editors > Text Editors > Hyperlinking, then untick "Changelog Detector".

Anant Goswami
  • 318
  • 3
  • 14
1

i had a problem with Ctrl + click in debug mode, and fixed my issue by going to Preferences -> General -> Editors -> Text Editors -> Hyperlinking and unticking the Step Into Selection option.

Seems like it was assigned the same modifier as Open... and was causing a conflict.

Adrian C
  • 71
  • 3
0

Seems like you have a project dependency in your build path (see the project properties). Open the other project or delete it from the build path.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • I'm not seeing a build path in Project -> Properties. It's a Maven project, which might be a factor. – BlairHippo Nov 07 '13 at 16:32
  • 1
    Actually, there seems to be a question on this (http://stackoverflow.com/questions/10484500/maven-integration-in-eclipse-new-project-checked-out-but-cant-navigate). Apparently, importing these projects from a different workspace rather than checking them out of the repository is the problem. I'm not seeing ways to fix it, just recommendations to start over. – BlairHippo Nov 07 '13 at 16:35
  • What happens when you select "Maven / Update Project" from the context menu? – Aaron Digulla Nov 07 '13 at 16:39
  • Doesn't have any effect. – BlairHippo Nov 07 '13 at 16:44
0

The src folder needs to be in the Java Build path. I had a similar issue in a non-Maven project and resolved it by adding Project/src folder in (Project Properties | Java Build Path | Source).

Atif Majeed
  • 1,021
  • 17
  • 14
0

Check your projects are not closed in eclipse.

Kalpesh
  • 694
  • 2
  • 8
  • 28
0

I had the same problems, Just deleted .classpath file from all project . then it started working :)

Monaj
  • 245
  • 3
  • 15
0

Try deleting .metadata folder from your source and re-import all maven project in your eclipse.

veenit sahay
  • 1
  • 1
  • 2
0

If it's a maven project, refresh maven.

  • Select a project > Maven > Refresh Maven
  • Select all projects
  • OK
B Shelton
  • 134
  • 4
0

Delete project from eclipse and import again, it resolved for me.

Vardesh k
  • 11
  • 1
0

If you have this problem with a HTML or Javascript file then it could help when you convert yor project to a Javascript project.
In the Project explorer:
Context menu on your project -> Configure -> Convert to Javascript project.

SJX
  • 1,071
  • 14
  • 15
0

Check the scalability settings to ensure that it is not enabled at Window > Preferences > C/C++ > Editor > Scalability.

For large files Eclipse turns on scalability mode which can disable editor live parsing.

hpd
  • 475
  • 1
  • 4
  • 16
0

For me updating the eclipse worked. I am using eclipse(22-06)

help > About Eclipse IDE > Installation Details > update

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – learning Jan 05 '23 at 05:41
-1

(And this may well be related -- "Mark Occurrences" isn't working in that workspace either, even thought the "Toggle Mark Occurrences" button is pressed.)

This kind of problem occurs when you have opened a .class file, or you have opened a file which is not in the build path of the project ( especially with maven projects in eclipse ). So maybe your issue is related to some class path problems in eclipse settings file. The project might be compiling fine, but eclipse may not be displaying the files and folders correctly and thus the editor is unable to determine the link when you press CTRL-click. So verify your eclipse settings and make sure that all source folders are declared as "source folders" and are added to the build path.

Also verify that you are in the correct "perspective" that understands java syntax (Java perspecive or JEE prespective)

Saif Asif
  • 5,516
  • 3
  • 31
  • 48
-1

I am working on Oxygen Eclipse . All you have to do is Right click on the Cucumber file Project and Click on Close project and Then again Double click on Project Link.