Newbie: ant works - eclipse build doesn't

S

sheinrich

Hi all,

in trying to get the examples up and running that come with the book
'Lucene in Action' I came across the following problems:

The build notes said that as only prerequisites the JUnit classes were
to be put into ANT_HOME/lib and I added the them as external jar to
the project build path.

After the workspace rebuild only two (red) error markings were shown
in source NekoHTMLHandler.java:

import org.apache.html.dom.HTMLDocumentImpl;
'The import org.apache.html cannot be resolved'

and the subsequent use of this class

DocumentFragment node =
new HTMLDocumentImpl().createDocumentFragment();
'HTMLDocumentImpl cannot be resolved to a type'

I thought that probably some classes were dropped from the JRE since
the examples were written and tracked down the missing one in the
xerces2 lib which I also included as an external jar.

The error markings were gone but the default build of all classes with
the integrated ant came up with:
....
ready-set-go:
[echo] The code will next be compiled and the test indexes will
be
[echo] created. This process is only done once. Follow the
[echo] instructions from the README (or as shown from "ant help")
[echo] after this process completes.
check-environment:
compile:
[mkdir] Created dir: C:\dev\workspace\LuceneInAction\build\classes
[javac] Compiling 104 source files to C:\dev\workspace
\LuceneInAction\build\classes
[javac] C:\dev\workspace\LuceneInAction\src\lia\handlingtypes\html
\NekoHTMLHandler.java:18: package org.apache.html.dom does not exist
[javac] import org.apache.html.dom.HTMLDocumentImpl;
[javac] ^
[javac] C:\dev\workspace\LuceneInAction\src\lia\handlingtypes\html
\NekoHTMLHandler.java:32: cannot find symbol
[javac] symbol : class HTMLDocumentImpl
[javac] location: class lia.handlingtypes.html.NekoHTMLHandler
[javac] new HTMLDocumentImpl().createDocumentFragment();
[javac] ^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors

BUILD FAILED
C:\dev\workspace\LuceneInAction\build.xml:66: Compile failed; see the
compiler error output for details.

Total time: 8 seconds


I tried different JRE and xerces versions to no avail.
Also moving the xerces lib up in order to the very top of all
inclusions did not change a thing.

But I succeeded from the command line with the integrated ant and the
same libraries!

Before in eclipse, with the necessary libraries and all errors in the
package view gone it was even possible to edit the
NekoHTMLHandler.java source in the java editor with correct
suggestions by the content wizard.
Like when writing HTMLDocumentImpl().cr.....
the method createDocumentFragment() was on top of the suggestions.

Still, running the actual build inevitably produced the same 2 errors.

I would very much appreciate any enlightenment of what went wrong as
help to better understand eclipse.

eclipse 3.2.2 with integrated ant 1.6.5 against JDK 1.5.0-11 on
Windows XP

TYIA,

steffen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top