我开始使用lucene。我使用lucene 8.1.1 在创建类MemoryIndex时,程序将引发异常。
我添加了库引用: lucene内存8.1.1 lucene-core-8.1.1
import org.apache.lucene.index.memory.MemoryIndex;
public class RunTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
MemoryIndex mi = new MemoryIndex();
}
}
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/index/memory/MemoryIndex
at RunTest.main(RunTest.java:8)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.index.memory.MemoryIndex
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 1 more