Eclipse如何将包含javadocs / source的jar与其二进制文件进行链接? [英] Eclipse how to link a jar containing javadocs/source with its binary?

查看:131
本文介绍了Eclipse如何将包含javadocs / source的jar与其二进制文件进行链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



例如,在下载JODA-2.0之后,我希望在Eclipse中显示包含在jar文件中的javadoc注释,获得三个罐子:





在eclipse中,[右键单击项目 - >属性 - > Java构建路径 - >库 - > ADD JAR ...]包含项目中的二进制文件(可以引用这些类)为joda-time-2.0.jar。



但是如何链接到源/另外两个jar文件中包含javadoc注释,所以当我将鼠标悬停在这些类上时,我看到了javadocs?



添加其他两个jar(joda-time-2.0-javadoc jar和joda-time -2.0-sources.jar)到构建路径不链接javadocs或源。

解决方案

你可以尝试CTRL +单击没有附加源的类(在编辑器中这样做)。当它显示一些有关该类的信息时,您将看到指导附加源对话框的按钮。点击它并在弹出的对话框中选择您的类的源/ javadoc位置。



您还可以从项目构建路径设置中提到:选择库选项卡,扩展您想要的库(jar),您将被提供选择:源附件,javadoc附件,本地库位置等。您只需选择所需的内容并编辑其当前设置。



或者你可以像@JB Nizet那样说...


I would like to have the javadoc comments contained in a jar file show in eclipse when I hover over a class.

For example, after downloading JODA-2.0, three jars are obtained:

In eclipse, [right click project -> Properties -> Java Build Path -> Libraries -> ADD JARs...] includes the binary in the project (can reference those classes) for joda-time-2.0.jar.

But how can I link in the sources/javadoc comments contained in the other two jar files so that when I hover over those classes I see the javadocs?

Adding the other two jars (joda-time-2.0-javadoc.jar and joda-time-2.0-sources.jar) to the build path does not link the javadocs or the source.

解决方案

You can try to CTRL + click on a class that has no source attached (do that in editor). When it shows you some info about the class you'll see the button that guides to attach source dialog. Click it and in dialog that pops up pick the source/javadoc location for your class.

You can also do that from project build path settings you are mentioning: pick libraries tab, expand the library (jar) you want and you'll be offered to pick: source attachment, javadoc attachment, native library location, etc. You just pick whatever you want and edit its current settings.

Or you can do as @JB Nizet said...

这篇关于Eclipse如何将包含javadocs / source的jar与其二进制文件进行链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆