Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ctrl+click doesn't work in Eclipse Juno

Tags:

java

eclipse

For every version of Eclipse I've used prior to Juno, ctrl+click would find the declaration of a variable/class/method. It was an extremely useful feature when dealing with a large code base. How do I get Juno to do this?

like image 439
comp sci balla Avatar asked Aug 02 '12 00:08

comp sci balla


People also ask

Why Ctrl click not working in Eclipse?

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).

How do I enable open declaration in Eclipse?

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


2 Answers

I can confirm that Ctrl + click works fine with the following :

Eclipse Java EE IDE for Web Developers. Version: Juno Release Build id: 20120606-2254 Operating System : Windows 7, 64 Bit 

What do you have for the following preference ?

On Window -> Preferences -> General -> Editors -> Text Editors -> Hyperlinking -> Open Declaration 

Here is what I had for a new workspace in Juno :

enter image description here

Update

I have not experienced this in the recent past, but I vaguely remember encountering this problem in previous Eclipse releases (Galileo and earlier).

All of what follows is worth doing only if we are sure that it's a problem with the Eclipse workspace. A quick way of checking this is to restart eclipse with a new workspace (Do this by going to File -> Switch Workspace -> Other... and choosing the path to a folder which is preferably empty and different than the current workspace folder).

If things worked in the new workspace, my fix then was one of the following, in increasing order extremeness :

  1. Re-start eclipse (Yup, sometimes that is all it took)
  2. Re-start eclipse with the -clean parameter to clean out the workspace ( See this). This might specially be worth doing if you used a workspace from an older version of eclipse.
  3. When the above failed, and I just had to use my existing workspace, I backed up my workspace folder and restarted Eclipse after deleting WORKSPACE_FOLDER/.metadata/.plugins/org.eclipse.jdt.core
like image 92
Ashutosh Jindal Avatar answered Sep 21 '22 15:09

Ashutosh Jindal


For me it helped to simply close the edited source file and reopen it. If this doesn't work THEN you can try restarting whole IDE.

like image 21
Mariusz Ignatowicz Avatar answered Sep 23 '22 15:09

Mariusz Ignatowicz