我下載的源代碼從這裏 - >http://lucene.apache.org/core/4_5_1/demo/overview-summary.html爲什麼我不能用javac編譯lucene演示源代碼?
現在我已經去到源文件,IndexFiles.java,我輸入javac IndexFiles,但我得到了一堆符號的未發現的錯誤。爲什麼?我更改了我的類路徑,並在目錄中添加了所有* .jar文件。我在這裏可能會錯過什麼?我能夠使用二進制文件並運行演示,但是我想搗亂演示並改變它的一些行爲,所以我想從源代碼編譯。
當我鍵入javac IndexFiles.java
我收到了一堆錯誤這一脈:
package org.apache.lucene.analysis does not exist
import org.apache.lucene.analysis.Analyzer;
^
IndexFiles.java:20: error: package org.apache.lucene.analysis.standard does not exist
import org.apache.lucene.analysis.standard.StandardAnalyzer;
^
IndexFiles.java:21: error: package org.apache.lucene.document does not exist
import org.apache.lucene.document.Document;
^
IndexFiles.java:22: error: package org.apache.lucene.document does not exist
import org.apache.lucene.document.Field;
^
IndexFiles.java:23: error: package org.apache.lucene.document does not exist
import org.apache.lucene.document.LongField;
^
IndexFiles.java:24: error: package org.apache.lucene.document does not exist
import org.apache.lucene.document.StringField;
^
IndexFiles.java:25: error: package org.apache.lucene.document does not exist
import org.apache.lucene.document.TextField;
^
IndexFiles.java:26: error: package org.apache.lucene.index does not exist
import org.apache.lucene.index.IndexWriter;
^
IndexFiles.java:27: error: package org.apache.lucene.index.IndexWriterConfig does not exist
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
^
IndexFiles.java:28: error: package org.apache.lucene.index does not exist
import org.apache.lucene.index.IndexWriterConfig;
^
IndexFiles.java:29: error: package org.apache.lucene.index does not exist
import org.apache.lucene.index.Term;
^
此解決方案的任何解決方案?當我嘗試爲我的定製分析儀創建JAR時,我遇到了一個類似的問題。 – Milee
我也有同樣的問題。任何答案呢? – ArmenB