lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Cuttler <br...@wadsworth.org>
Subject Re: Modify demo jar files, build completed
Date Thu, 07 Nov 2002 20:04:02 GMT

FYI... modified demo java code.

1) ignore "ant".

2) the correct CLASSPATH env-var is one that includes
   the current lucene-1.2.jar and lucene-demos-1.2.jar files.

3) javac of the modified source java file then completes
   without error producing a new .class file the the IndexHTML.java
   file ie IndexHTML.class.

4) I did not see an option in the "jar" man page to replace the
   module in the lucene-demos-1.2.jar file so I used the extract
   command, replaced the .class file for the modified file and
   then produced a new jar file from all of the class files.

5) We will modify the jsp code to pretty it up a little for our
   site and will most likely produce a few sub-indexes and additional
   jsp code to support them.

Is there a "better" way to do step 5 ?

Thanks for the assistance I've received from the lucene-user group.

						Brian

> I've installed ant 1.5.1 on Solaris 8 so that I could modify
> the demo jar files that come with Lucene 1.2.
> 
> I've made a small modification to IndexHTML.java which is
> under /lucene-1.2-src/src/demo/org/apache/lucene/demo, I've
> modified the code to exclude the indexing of the .txt files.
> 
> I believe I have to compile the java file in order to create
> a class file in order to replace IndexHTML in the demo.jar file.
> 
> If there is already code I can use that will index only the
> htm and html files I'd be happy to use it...
> 
> Is that right ? Can I do that directly (it produced errors and
> I don't know quite enough about java, ok, I don't know anything
> about java).
> 
> Obviously this didn't work so looking at the read.me I tried
> a second attempt using ANT.
> 
> # javac IndexHTML.java
> IndexHTML.java:57: Class
> org.apache.lucene.analysis.standard.StandardAnalyzer not found in
> import.
> import org.apache.lucene.analysis.standard.StandardAnalyzer;
>        ^
> IndexHTML.java:58: Package org.apache.lucene.index not found in
> import.
> import org.apache.lucene.index.*;
>        ^
> IndexHTML.java:59: Class org.apache.lucene.document.Document not
> found in import.
> import org.apache.lucene.document.Document;
>        ^
> IndexHTML.java:60: Class org.apache.lucene.util.Arrays not found in
> import.
> import org.apache.lucene.util.Arrays;
>        ^
> IndexHTML.java:61: Class org.apache.lucene.demo.html.HTMLParser not
> found in import.
> import org.apache.lucene.demo.html.HTMLParser;
>        ^
> 5 errors
> 
> 
> I've added /usr/local/ant to my PATH.
> 
> I've set CLASSPATH to /tmp/ant/jakarta-ant-1.5.1/lib because
> I thought ant  needed to find its jar files (and that is where
> they are).
> 
> I # cd to the top level of the lucene file...
> 
> # cd /tmp/lucene/lucene-1.2-src
> # ls
> BUILD.txt           README.txt          default.properties  src
> CHANGES.txt         TODO.txt            lib
> LICENSE.txt         build.xml           lucene-1.2-src.jar
> 
> Run ant...
> 
> # ant
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/tools/ant/Main
> 
> I realize I'm probably making some hidiously novice mistake.. can
> someone
> help me out ?

---
   Brian R Cuttler                 brian.cuttler@wadsworth.org
   Computer Systems Support        (v) 518 486-1697
   Wadsworth Center                (f) 518 473-6384
   NYS Department of Health        Help Desk 518 473-0773


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message