无法导入org.apache.lucene [英] Cannot import org.apache.lucene
问题描述
我想使用 lucene 库.我已经下载了它,并将其作为Zip文件[项目属性->库->添加Jar/文件夹]添加到我的项目中.但是我根本无法导入它.当我输入时:
I wanted to use lucene library. I have downloaded it and added it as Zip file [project properties--> Libraries --> Add Jar/Folder]to my project. But I simply cannot import it. when i type in:
import org.apache.lucene.analysis.Token;
它只是说包不存在!
如果我输入
导入组织.
import org.
它给了我一些建议,但没有阿帕奇.
it gives me some suggestions but no apache.
由于我已经导入了guava.jar并使用了google.common库,因此Netbeans可以正常工作.
Netbeans works fine since i already imported guava.jar and using the google.common libraries.
与我添加一个zip作为库有什么关系吗?添加zip文件后,我还能做些额外的事情吗?我应该在哪里检查一下?
Does it has anything to do with me adding a zip as the library? shall i do something extra after i added zip file? is there anywhere that i should check?
推荐答案
我认为您下载了一个包含多个Lucene jar文件的zip文件.
I think you downloaded a zip containing several lucene jar files.
该zip包含不同的Lucenes jar文件,您需要将其解压缩并添加
That zip contains different lucenes jar files, you need to extract it and add
- core/lucene-core-4.8.0.jar
- analysis/common/lucene-analyzers-common-4.8.0.jar
作为对项目的依赖项.
这篇关于无法导入org.apache.lucene的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!