我使用Lucene的API,我就在這行我的代碼以下錯誤:Java中,無法找到符號:方法方法名(org.bla.blabla.myClass)
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.Fieldable;
...
Document _document = new Document();
_document.add(new Field("type", document.getType()));
錯誤: CollectionIndexer.java:34:找不到符號 symbol:方法add(org.apache.lucene.document.Field) location:class CollectionIndexer.Document _document.add(new Field(「type」,document.getType()) );
這是一個關於該方法的文檔: http://lucene.apache.org/java/3_0_3/api/all/org/apache/lucene/document/Document.html#add(org.apache.lucene.document.Fieldable)
感謝
更新:javac的-cp公地消化器-2.1 /公地消化器-2.1.jar:lucene的核 - 3.0.3的.jar myApp.java
你叫什麼對象myMethod方法? – reef 2011-02-23 15:03:27
這裏幾乎沒有足夠的信息來建議任何明智的!你可以添加一個minimable(非)可編譯的代碼片段嗎? – 2011-02-23 15:03:46
@Patrick,請爲此問題提供[SSCCE](http://sscce.org/)。 – aioobe 2011-02-23 15:06:02