新版本的ADT r17插件为Eclipse添加了自动设置JAR依赖项的功能。/libs文件夹中的任何.jar文件现在都被添加到构建配置中。不幸的是,Android依赖类路径容器是不可修改的。
如何将javadoc和源代码附加到自动插入的.jar(从/libs文件夹)?
新版本的ADT r17插件为Eclipse添加了自动设置JAR依赖项的功能。/libs文件夹中的任何.jar文件现在都被添加到构建配置中。不幸的是,Android依赖类路径容器是不可修改的。
如何将javadoc和源代码附加到自动插入的.jar(从/libs文件夹)?
当前回答
只需更新ADT插件。这对我很管用!!
Start Eclipse, then select Help > Install New Software. Click Add, in the top-right corner. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ Note: The Android Developer Tools update site requires a secure connection. Make sure the update site URL you enter starts with HTTPS. Click OK. In the Available Software dialog, select the checkbox next to Developer Tools and click Next. In the next window, you'll see a list of the tools to be downloaded. Click Next. Read and accept the license agreements, then click Finish. If you get a security warning saying that the authenticity or validity of the software can't be established, click OK. When the installation completes, restart Eclipse
希望有帮助!
其他回答
对于任何给定的jar,如果您希望在编码时在工具提示中看到Javadoc帮助,请执行以下操作: 右键单击项目>属性> Java构建路径>库选项卡。单击罐子旁边的箭头展开。
源附件应该指向实际jar的位置(可能就在java文件夹中)。
Javadoc位置:这里有两个选择:URL和存档。如果这个jar的javadocs是一个文件夹的形式,在第一层包含一个index.html文件,选择“Javadoc URL”并指向该文件夹。 如果你的Javadoc在一个jar中,选择“Javadoc in archive”并指向这个jar。 不要忘记重新启动工作区/关闭并重新打开项目,以使用Javadoc信息更新工具提示。
我希望这有助于为我认为应该是非常简单的任务提供一个简单的答案。
在ADT 22上,我无法访问common -io- 2.4.4 .jar和android-support-v4.jar的Javadoc
这是我解决它的方法:
前提条件:这两个库都列在“参考库”下。 右键单击commons-io-2.4.jar并选择Properties。此窗口显示:
commons-io-2.4.jar与commons-io-2.4-javadoc.jar捆绑在一起,因此我在归档外部文件路径中指定了Javadoc。
我对支持库做了同样的事情:右键单击android-support-v4.jar并选择Properties。此屏幕显示:
这一次,我指定了源目录的路径。
我知道这个问题已经很老了,但是当我昨天遇到同样的问题时,上面发布的解决方案对我来说太烦人了,我发现可以很容易地在项目的.classpath文件中添加源路径定义。然后Eclipse将对其进行改编,您就可以浏览源代码了。
之前的类路径条目:
<classpathentry kind="lib" path="[PATH_TO_MY_JAR]"/>
将路径添加到源后
<classpathentry kind="lib" path="[PATH_TO_MY_JAR]" sourcepath="[PATH_TO_MY_SOURCE_JAR]"/>
希望这能有所帮助
我的解决方案:
下载一个名为“Java Source Attacher Feature”的eclipse插件。
稍后,选择一个jar并使用这个插件附加源代码。点击jar文件来选择它,鼠标右键,然后选择“附加java源代码”。
有了源代码,就自动有了javadoc。
现在可以在类上使用F2来查看相关的javadoc。
享受
只需更新ADT插件。这对我很管用!!
Start Eclipse, then select Help > Install New Software. Click Add, in the top-right corner. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ Note: The Android Developer Tools update site requires a secure connection. Make sure the update site URL you enter starts with HTTPS. Click OK. In the Available Software dialog, select the checkbox next to Developer Tools and click Next. In the next window, you'll see a list of the tools to be downloaded. Click Next. Read and accept the license agreements, then click Finish. If you get a security warning saying that the authenticity or validity of the software can't be established, click OK. When the installation completes, restart Eclipse
希望有帮助!