2014-02-06 143 views
0

修復了類似tools.jar和junit.jar的錯誤(感謝堆棧溢出)之後,我嘗試編譯「lucene in action」一書中給出的示例。但是當我編譯我得到這個錯誤。你能說出我得到的錯誤以及如何解決它?運行lucene示例時編譯失敗


Total time: 0 seconds 

E:\LuceneInAction>ant Indexer 
Buildfile: E:\LuceneInAction\build.xml 

check-environment: 

compile: 
[javac] E:\LuceneInAction\build.xml:66: warning: 'includeantruntime' was not 
set, defaulting to build.sysclasspath=last; set to false for repeatable builds 
[javac] Compiling 104 source files to E:\LuceneInAction\build\classes 
[javac] E:\LuceneInAction\src\lia\analysis\AnalyzerUtils.java:3: warning: [d 
eprecation] Assert in junit.framework has been deprecated 
[javac] import junit.framework.Assert; 
[javac]      ^
[javac] E:\LuceneInAction\src\lia\handlingtypes\html\NekoHTMLHandler.java:18 
: error: package org.apache.html.dom does not exist 
[javac] import org.apache.html.dom.HTMLDocumentImpl; 
[javac]       ^
[javac] E:\LuceneInAction\src\lia\analysis\AnalyzerUtils.java:90: warning: [ 
deprecation] Assert in junit.framework has been deprecated 
[javac]  Assert.assertEquals(strings.length, tokens.length); 
[javac] ^
[javac] E:\LuceneInAction\src\lia\analysis\AnalyzerUtils.java:93: warning: [ 
deprecation] Assert in junit.framework has been deprecated 
[javac]  Assert.assertEquals("index " + i, strings[i], tokens[i].termTe 
xt()); 
[javac]  ^
[javac] E:\LuceneInAction\src\lia\handlingtypes\html\NekoHTMLHandler.java:32 
: error: cannot find symbol 
[javac]  new HTMLDocumentImpl().createDocumentFragment(); 
[javac]   ^
[javac] symbol: class HTMLDocumentImpl 
[javac] location: class NekoHTMLHandler 
[javac] Note: Some input files use unchecked or unsafe operations. 
[javac] Note: Recompile with -Xlint:unchecked for details. 
[javac] 2 errors 
[javac] 3 warnings 

BUILD FAILED 
E:\LuceneInAction\build.xml:66: Compile failed; see the compiler error output fo 
r details. 

Total time: 2 seconds 

對不起,我沒有足夠的reputaion發佈圖像

+0

你必須添加junit和其他遺失的罐子(見錯誤)到您的構建路徑。 – Drogba

+0

@Drogba我將junit添加到E:/ ant/lib。我需要添加任何其他罐子 – samnaction

回答

0

Tt的抱怨你的罐子包含HtmlDocumentImpl不要正對classpath。也許xerces?一個特定的版本。 JUnits是一個警告,它是來自org.frameworkAssert。你可以更新你的JUnit jar文件,或者保持原樣,因爲這不是錯誤的原因。

錯誤是由於一個jar不在你的類路徑上。在我的猜測是xerces

+0

我需要做什麼。對不起,我是這個 – samnaction

+0

的一個完整noob,添加包含'HtmlDocumentImpl'類的'xerces' jar,就像你添加'jUnit'的方式。 – Hrishikesh

+0

謝謝你的工作 – samnaction