将库导入Eclipse [英] Importing a library into Eclipse

查看:128
本文介绍了将库导入Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的项目中使用Lucene。
当我简单地将.jar文件复制到我的项目中,而不是我得到错误注意:该元素既没有附加源也没有附加Javadoc,因此没有找到Javadoc。
如何在Eclipse中导入像Lucene一样的库?

解决方案

您导入的是正确的。如果你那么远,你可以使用jar中的所有类。在编辑过程中,无法显示javadoc中的所有有用提示,并且无法跳转到库的代码中。



您可以在项目构建路径设置中添加源代码和javadoc。


  1. 右键单击您的项目并选择属性

  2. 选择Java构建路径

  3. 现在选择Libraries(您应该看到列出的jar) / li>
  4. 点击图书馆的箭头来展开它的设置(你应该看到类似JavaDoc的东西和源附件没有)

  5. 现在,如果你想添加源点击源附件无项目并选择编辑。

  6. 现在将路径信息提供给包含源的文件夹或jar,然后单击ok。

  7. 为java文档执行相同的操作


I want to use Lucene in my project. When I simply copy the .jar file into my project than I get the error "Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found." How do I import a library like Lucene the right way in Eclipse?

解决方案

You have imported it correct. You can use all the classes from the jar if you are that far. You can't display all the useful hints from the javadoc during editing and you can't jump into the code of the library.

You can add the source and the javadoc later on in your projects build path settings.

  1. Right click on your project and select Properties
  2. Choose Java Build Path
  3. Now select Libraries (you should see the jar listed)
  4. Click on the arrow of the library to expand its settings (You should see something like JavaDoc none and source attachment none)
  5. Now if you want to add the source click on the source attachment none item and select edit.
  6. Now supply the path information to the folder or the jar containing the source and click okay.
  7. Do the same thing for the java doc

这篇关于将库导入Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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