简体   繁体   中英

Source code navigation and JavaDoc bug in Eclipse Indigo

I have a problem with Eclipse Indigo regarding library source code. When I open a library class (eg from the JDK, but also from some other included libraries, such as Guava), either using the Open Type dialogue or simply through Ctrl + click on the class name or some of its methods, once in a while (not always) something breaks.

Don't get me wrong, the source is always displayed without any problem (either JDK source shipped with the JDK itself or Guava source downloaded by Maven). What actually stops to work:

  • When I open the Quick Outline popup in that given class using Ctrl + O , the list of methods and fields displays normally, but when I click on any of them, Eclipse doesn't move the view on it as it should. Also Ctrl + clicking any of the methods or fields of that class in my code doesn't bring me directly to it, but simply at the top of the source file.
  • When I hover over that said class or its methods, no JavaDoc appears in the popup as you can see in the attached image. I am in the HashSet class, the source is clearly there, but it isn't displayed in the popup.

HashSet JavaDoc消失了

I found out that this can be fixed by opening the Outline View and briefly clicking through the class's methods and fields. After a few clicks, Eclipse catches on and starts to work correctly, but only for this one class, not for all which are broken in this way at the moment.

Has anybody met this kind of bug? Is it tracked at Eclipse Bugzilla? Thanks in advance for any advice.

For completeness, this is my configuration:

Windows 7 Professional x64
Oracle JDK 1.7 Update 2 32b
Eclipse Indigo for Java EE Developers 32b

your issue #2 may be resolved by following these steps :

  1. Go to http://java.sun.com/j2se/1.5.0/download.jsp and choose to download the JDK 5.0 Source Code.
  2. For JDK 5.0, select Download(SCSL source).
  3. Download JDK (SCSL) 5.0 (1.5.0). This will give you a file jdk-1_5_0-src.scsl.zip. You do not need to unzip this file; Eclipse likes it the way it is.
  4. In Eclipse, go to Projects -> Properties -> Java Build Path -> Libraries and expand JRE System Library [jre 1.5.0], then rt.jar. Select Source attachment and click Edit...
  5. Select the above zip file. and Finish by exiting the dialog boxes.

source

Hope this helps..

为了回答我自己的问题,我没有找到如何解决Indigo中的问题,但更新到Juno修复了它。

Sounds like wrong sources are attached to the libs inside Eclipse.

I had similar symptoms in a project where a class exist in both: inside a lib and in the project's src folder. Same canonical class name, but different implementations.

I would recommend to verify (or reinstall) your JDK-Installation and re-configurating it in Eclipse.

Hitting Ctrl+Shift+T and typing HashSet and taking a screenshot of that window may help here, too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM