2014-02-06 73 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