简体   繁体   English

Eclipse Helios没有显示Javadoc

[英]Eclipse Helios not showing Javadoc

I have recently got a new computer and I have put Eclipse Helios on there. 我最近有一台新电脑,我把Eclipse Helios放在那里。 Before, on my old computer, when I used the control-assist (Ctrl + Space) and highlighted the suggested methods, the Javadoc for that method used to appear at the side of the control assist pop up window with the method description and parameters etc... 之前,在我的旧计算机上,当我使用控制辅助(Ctrl + Space)并突出显示建议的方法时,该方法的Javadoc曾经出现在控制辅助弹出窗口的侧面,带有方法描述和参数等...

However, on my new computer this Javadoc doesn't appear and only the method suggestions appear - but even the arguments for the methods aren't named (they're just called arg0 , arg1 and so on). 但是,在我的新计算机上,这个Javadoc没有出现,只显示了方法建议 - 但即使是方法的参数也没有命名(它们只是被称为arg0arg1等等)。 The only thing I can think of that is different on the new install is ZoneAlarm but as far as I can see I have allowed eclipse through the firewall; 我唯一可以想到的是新安装的区别是ZoneAlarm,但据我所知,我已经允许eclipse通过防火墙; unless it's something to do with Java itself. 除非它与Java本身有关。

This feature is really useful to me so any advice on how to resolve this issue would be greatly appreciated. 此功能对我非常有用,因此任何有关如何解决此问题的建议将不胜感激。 Thanks in advance. 提前致谢。

Eclipse is using a JRE instead of a JDK as the default Java. Eclipse使用JRE而不是JDK作为默认Java。

  • Download and install a JDK. 下载并安装JDK。
  • In Eclipse Preferences, Java -> Installed JRE's. 在Eclipse Preferences中,Java - > Installed JRE。 Use "Add" or "Search" to locate and add the JDK just installed. 使用“添加”或“搜索”找到并添加刚刚安装的JDK。
  • Move the check mark indicating the default Java to the newly found JDK. 将表示默认Java的复选标记移动到新找到的JDK。
  • Allow the workspace to rebuild. 允许工作区重建。

You need to press F3 on the Class or Method name you want to see javadoc for. 您需要在要查看javadoc的类或方法名称上按F3。 Then in the editor it's source will open or if you don't have source attached, you'll have screen with bytecode saying that no sources attached. 然后在编辑器中它的源代码将打开,或者如果你没有附加源代码,你将拥有带字节码的屏幕,表示没有附加源代码。 Then you need to open package view, by default it's on the left side. 然后你需要打开包视图,默认情况下它在左侧。 On the top of it there is an icon with two arrows, if it's not pressed, press it. 在它的顶部有一个带有两个箭头的图标,如果没有按下,按下它。 It will show source you've opened in the package view, then you need to find jar file containing your source by scrolling up if you already don't stand on it. 它将显示您在包视图中打开的源,然后您需要通过向上滚动查找包含您的源的jar文件,如果您已经没有站在它上面。

Now press right mouse button on that jar, you'll see properties window. 现在在该jar上按鼠标右键,您将看到属性窗口。 Select javadoc, then you need to select location of the javadoc. 选择javadoc,然后你需要选择javadoc的位置。 You can provide a URL to an online javadoc. 您可以提供在线javadoc的URL。 The URL you will be pointing to must provide a page named 'index.html' or similar or Eclipse won't allow you to use that URL. 您将指向的URL必须提供名为“index.html”或类似的页面,否则Eclipse将不允许您使用该URL。 Also you can download javadoc locally and then select the location of that javadoc archive. 您也可以在本地下载javadoc,然后选择该javadoc存档的位置。 If you need the javadoc for java SE libraries, you can find it in your jdk installation directory in src.zip folder. 如果需要java SE库的javadoc,可以在src.zip文件夹的jdk安装目录中找到它。 Hope it'll help. 希望它会有所帮助。

Did you specify the javadoc location of your library? 您是否指定了库的javadoc位置?

Window -> Preferences -> Java -> Installed JREs -> Select your JRE -> Edit -> Select .jar file(s) (rt.jar) -> Javadoc Location 窗口 - >首选项 - > Java - >已安装的JRE - >选择您的JRE - >编辑 - >选择.jar文件(rt.jar) - > Javadoc位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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