You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Federico Carbonetti <sm...@gmail.com> on 2005/12/27 00:31:16 UTC

Problem Getting Started...

Hello!
I'm new in the ML and in the Lucene world in general... :)
I re-installed JDK after a very long period in order to start using
Lucene but I had problems after few minutes I finished installing Java
and Lucene.

I installed:
JDK 1.5.0_06
Lucene 1.4.3

I've set the environment variables as follows:
PATH: C:\Sun\AppServer\bin; C:\Programmi\Java\jdk1.5.0_06\bin;
CLASSPATH: .; C:\Programmi\QuickTime\QTSystem\QTJava.zip;
C:\Programmi\lucene-1.4.3\lucene-1.4.3.jar;
C:\Programmi\lucene-1.4.3\lucene-demos-1.4.3.jar;

I then tried to follow the instructions found at
http://lucene.apache.org/java/docs/demo.html
so I opened a command prompt and typed: "java
org.apache.lucene.demo.IndexFiles C:\Programmi\lucene-1.4.3\src" and I
got the error "xception in thread "main" ... NoClassDefFound
org/apache/lucene/demo/IndexFiles" which means that it didn't find the
class definition.... But where is my mistake?

Can anybody help me pleeeeeeeease?? :)

Thanks a lot for your attention and, I hope, your help! :)
Bye, Federico

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Problem Getting Started...

Posted by Gaston <ga...@artentis.com>.
Hi,

I had the same problem at the beginning.

Try

java -classpath lucene-1.4-final.jar; lucene-demos-1.4-final.jar; 
org.apache.lucene.demo.IndexHTML -create -index webindex docs

If this fails go in the org/apache/lucene/demo directory and compile 
IndexHTML.java with the command
javac -classpath lucene-1.4-final.jar;lucene-demos-1.4-final.jar;  
org.apache.lucene.demo.IndexHTML.java

and then retry the first step out of  this mail.


Greetings


Gaston


Erik Hatcher schrieb:

> Are you running the Sun JVM?  Or some other JVM?
>
>
>     Erik
>
>
> On Dec 27, 2005, at 10:25 AM, Federico Carbonetti wrote:
>
>> hello erik and hello everybody!
>>
>> 2005/12/27, Erik Hatcher <er...@ehatchersolutions.com>:
>>
>>>
>>> On Dec 26, 2005, at 6:31 PM, Federico Carbonetti wrote:
>>>
>>>> I'm new in the ML and in the Lucene world in general... :)
>>>
>>>
>>> ML?
>>>
>>
>> Mailing List! ehehe! :)
>>
>> this morning i changed some settings for the PATH variabile, but I'm
>> still experiencing the same trouble. I tried to extract lucene
>> following the hints given in the appendix of "lucene in action" (I've
>> that book) but without success... I downloaded lucene-1.4-final.zip,
>> extracted to C:\lucene-1.4-final\ and updated the classpath of
>> windows. Somebody told me to set the JVM classpath by typing:
>>
>> java -cp lucene-1.4-final.jar; -jar lucene-demos-1.4-final.jar
>>
>> but I got the following message:
>> Failed to load Main-Class manifest attribute from lucene-demos-1.4- 
>> final.jar
>>
>> While when i Try to set the classpath as suggested in the appendix
>> (java -cp lucene-1.4-final.jar; lucene-demos-1.4-final.jar) i got the
>> "usual" Exception in thread "main"...
>>
>> Does anybody know the solution to my problem please? :)
>>
>> Thanks again! Bye
>>
>>>
>>> Federico,
>>>
>>> I'm pasting below the relevant piece of the "Installing Lucene"
>>> appendix, I hope this helps.  At first glance, the environment and
>>> steps you described seemed fine, so I'm not sure what is awry.
>>>
>>> I hope the info below helps:
>>>
>>> Running the command-line demo
>>> The command-line Lucene demo consists of two command-line  programs: 
>>> one
>>> that indexes a directory tree of files and another that provides a
>>> simple search
>>> interface. To run this demo, set your current working directory to
>>> the directory
>>> where the binary distribution was expanded. Next, run the IndexFiles
>>> program
>>> like this:
>>>
>>>    java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
>>> org.apache.lucene.demo.IndexFiles docs
>>> .
>>> .
>>> .
>>> adding docs/queryparsersyntax.html
>>> adding docs/resources.html
>>> adding docs/systemproperties.html
>>> adding docs/whoweare.html
>>> 9454 total milliseconds
>>>
>>> This command indexes the entire docs directory tree (339 files in our
>>> case) into
>>> an index stored in the index subdirectory of the location where you
>>> executed
>>> the command.
>>>
>>> NOTE Literally every file in the docs directory tree is indexed,
>>> including .gif
>>> and .jpg files. None of the files are parsed; instead, each file is
>>> indexed
>>> by streaming its bytes into StandardAnalyzer.
>>>
>>> To search the index just created, execute SearchFiles in this manner:
>>>
>>>    java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
>>>                  org.apache.lucene.demo.SearchFiles
>>>
>>> Query: IndexSearcher AND QueryParser
>>> Searching for: +indexsearcher +queryparser
>>> 10 total matching documents
>>> 0. docs/api/index-all.html
>>> 1. docs/api/allclasses-frame.html
>>> 2. docs/api/allclasses-noframe.html
>>> 3. docs/api/org/apache/lucene/search/class-use/Query.html
>>> 4. docs/api/overview-summary.html
>>> 5. docs/api/overview-tree.html
>>> 6. docs/demo2.html
>>> 7. docs/demo4.html
>>> 8. docs/api/org/apache/lucene/search/package-summary.html
>>> 9. docs/api/org/apache/lucene/search/package-tree.html
>>>
>>> SearchFiles prompts interactively with Query:. QueryParser is used
>>> with Standard-
>>> Analyzer to create a Query. A maximum of 10 hits are shown at a time;
>>> if there are
>>> more, you can page through them. Press Ctrl-C to exit the program.
>>>
>>>         Erik
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Problem Getting Started...

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Are you running the Sun JVM?  Or some other JVM?


	Erik


On Dec 27, 2005, at 10:25 AM, Federico Carbonetti wrote:

> hello erik and hello everybody!
>
> 2005/12/27, Erik Hatcher <er...@ehatchersolutions.com>:
>>
>> On Dec 26, 2005, at 6:31 PM, Federico Carbonetti wrote:
>>> I'm new in the ML and in the Lucene world in general... :)
>>
>> ML?
>>
>
> Mailing List! ehehe! :)
>
> this morning i changed some settings for the PATH variabile, but I'm
> still experiencing the same trouble. I tried to extract lucene
> following the hints given in the appendix of "lucene in action" (I've
> that book) but without success... I downloaded lucene-1.4-final.zip,
> extracted to C:\lucene-1.4-final\ and updated the classpath of
> windows. Somebody told me to set the JVM classpath by typing:
>
> java -cp lucene-1.4-final.jar; -jar lucene-demos-1.4-final.jar
>
> but I got the following message:
> Failed to load Main-Class manifest attribute from lucene-demos-1.4- 
> final.jar
>
> While when i Try to set the classpath as suggested in the appendix
> (java -cp lucene-1.4-final.jar; lucene-demos-1.4-final.jar) i got the
> "usual" Exception in thread "main"...
>
> Does anybody know the solution to my problem please? :)
>
> Thanks again! Bye
>
>>
>> Federico,
>>
>> I'm pasting below the relevant piece of the "Installing Lucene"
>> appendix, I hope this helps.  At first glance, the environment and
>> steps you described seemed fine, so I'm not sure what is awry.
>>
>> I hope the info below helps:
>>
>> Running the command-line demo
>> The command-line Lucene demo consists of two command-line  
>> programs: one
>> that indexes a directory tree of files and another that provides a
>> simple search
>> interface. To run this demo, set your current working directory to
>> the directory
>> where the binary distribution was expanded. Next, run the IndexFiles
>> program
>> like this:
>>
>>    java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
>> org.apache.lucene.demo.IndexFiles docs
>> .
>> .
>> .
>> adding docs/queryparsersyntax.html
>> adding docs/resources.html
>> adding docs/systemproperties.html
>> adding docs/whoweare.html
>> 9454 total milliseconds
>>
>> This command indexes the entire docs directory tree (339 files in our
>> case) into
>> an index stored in the index subdirectory of the location where you
>> executed
>> the command.
>>
>> NOTE Literally every file in the docs directory tree is indexed,
>> including .gif
>> and .jpg files. None of the files are parsed; instead, each file is
>> indexed
>> by streaming its bytes into StandardAnalyzer.
>>
>> To search the index just created, execute SearchFiles in this manner:
>>
>>    java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
>>                  org.apache.lucene.demo.SearchFiles
>>
>> Query: IndexSearcher AND QueryParser
>> Searching for: +indexsearcher +queryparser
>> 10 total matching documents
>> 0. docs/api/index-all.html
>> 1. docs/api/allclasses-frame.html
>> 2. docs/api/allclasses-noframe.html
>> 3. docs/api/org/apache/lucene/search/class-use/Query.html
>> 4. docs/api/overview-summary.html
>> 5. docs/api/overview-tree.html
>> 6. docs/demo2.html
>> 7. docs/demo4.html
>> 8. docs/api/org/apache/lucene/search/package-summary.html
>> 9. docs/api/org/apache/lucene/search/package-tree.html
>>
>> SearchFiles prompts interactively with Query:. QueryParser is used
>> with Standard-
>> Analyzer to create a Query. A maximum of 10 hits are shown at a time;
>> if there are
>> more, you can page through them. Press Ctrl-C to exit the program.
>>
>>         Erik
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Problem Getting Started...

Posted by Federico Carbonetti <sm...@gmail.com>.
hello erik and hello everybody!

2005/12/27, Erik Hatcher <er...@ehatchersolutions.com>:
>
> On Dec 26, 2005, at 6:31 PM, Federico Carbonetti wrote:
> > I'm new in the ML and in the Lucene world in general... :)
>
> ML?
>

Mailing List! ehehe! :)

this morning i changed some settings for the PATH variabile, but I'm
still experiencing the same trouble. I tried to extract lucene
following the hints given in the appendix of "lucene in action" (I've
that book) but without success... I downloaded lucene-1.4-final.zip,
extracted to C:\lucene-1.4-final\ and updated the classpath of
windows. Somebody told me to set the JVM classpath by typing:

java -cp lucene-1.4-final.jar; -jar lucene-demos-1.4-final.jar

but I got the following message:
Failed to load Main-Class manifest attribute from lucene-demos-1.4-final.jar

While when i Try to set the classpath as suggested in the appendix
(java -cp lucene-1.4-final.jar; lucene-demos-1.4-final.jar) i got the
"usual" Exception in thread "main"...

Does anybody know the solution to my problem please? :)

Thanks again! Bye

>
> Federico,
>
> I'm pasting below the relevant piece of the "Installing Lucene"
> appendix, I hope this helps.  At first glance, the environment and
> steps you described seemed fine, so I'm not sure what is awry.
>
> I hope the info below helps:
>
> Running the command-line demo
> The command-line Lucene demo consists of two command-line programs: one
> that indexes a directory tree of files and another that provides a
> simple search
> interface. To run this demo, set your current working directory to
> the directory
> where the binary distribution was expanded. Next, run the IndexFiles
> program
> like this:
>
>    java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
> org.apache.lucene.demo.IndexFiles docs
> .
> .
> .
> adding docs/queryparsersyntax.html
> adding docs/resources.html
> adding docs/systemproperties.html
> adding docs/whoweare.html
> 9454 total milliseconds
>
> This command indexes the entire docs directory tree (339 files in our
> case) into
> an index stored in the index subdirectory of the location where you
> executed
> the command.
>
> NOTE Literally every file in the docs directory tree is indexed,
> including .gif
> and .jpg files. None of the files are parsed; instead, each file is
> indexed
> by streaming its bytes into StandardAnalyzer.
>
> To search the index just created, execute SearchFiles in this manner:
>
>    java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
>                  org.apache.lucene.demo.SearchFiles
>
> Query: IndexSearcher AND QueryParser
> Searching for: +indexsearcher +queryparser
> 10 total matching documents
> 0. docs/api/index-all.html
> 1. docs/api/allclasses-frame.html
> 2. docs/api/allclasses-noframe.html
> 3. docs/api/org/apache/lucene/search/class-use/Query.html
> 4. docs/api/overview-summary.html
> 5. docs/api/overview-tree.html
> 6. docs/demo2.html
> 7. docs/demo4.html
> 8. docs/api/org/apache/lucene/search/package-summary.html
> 9. docs/api/org/apache/lucene/search/package-tree.html
>
> SearchFiles prompts interactively with Query:. QueryParser is used
> with Standard-
> Analyzer to create a Query. A maximum of 10 hits are shown at a time;
> if there are
> more, you can page through them. Press Ctrl-C to exit the program.
>
>         Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Problem Getting Started...

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 26, 2005, at 6:31 PM, Federico Carbonetti wrote:
> I'm new in the ML and in the Lucene world in general... :)

ML?

> I then tried to follow the instructions found at
> http://lucene.apache.org/java/docs/demo.html
> so I opened a command prompt and typed: "java
> org.apache.lucene.demo.IndexFiles C:\Programmi\lucene-1.4.3\src" and I
> got the error "xception in thread "main" ... NoClassDefFound
> org/apache/lucene/demo/IndexFiles" which means that it didn't find the
> class definition.... But where is my mistake?
>
> Can anybody help me pleeeeeeeease?? :)

Federico,

I'm pasting below the relevant piece of the "Installing Lucene"  
appendix, I hope this helps.  At first glance, the environment and  
steps you described seemed fine, so I'm not sure what is awry.

I hope the info below helps:

Running the command-line demo
The command-line Lucene demo consists of two command-line programs: one
that indexes a directory tree of files and another that provides a  
simple search
interface. To run this demo, set your current working directory to  
the directory
where the binary distribution was expanded. Next, run the IndexFiles  
program
like this:

   java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar   
org.apache.lucene.demo.IndexFiles docs
.
.
.
adding docs/queryparsersyntax.html
adding docs/resources.html
adding docs/systemproperties.html
adding docs/whoweare.html
9454 total milliseconds

This command indexes the entire docs directory tree (339 files in our  
case) into
an index stored in the index subdirectory of the location where you  
executed
the command.

NOTE Literally every file in the docs directory tree is indexed,  
including .gif
and .jpg files. None of the files are parsed; instead, each file is  
indexed
by streaming its bytes into StandardAnalyzer.

To search the index just created, execute SearchFiles in this manner:

   java -cp lucene-1.4.2.jar;lucene-demos-1.4.2.jar
                 org.apache.lucene.demo.SearchFiles

Query: IndexSearcher AND QueryParser
Searching for: +indexsearcher +queryparser
10 total matching documents
0. docs/api/index-all.html
1. docs/api/allclasses-frame.html
2. docs/api/allclasses-noframe.html
3. docs/api/org/apache/lucene/search/class-use/Query.html
4. docs/api/overview-summary.html
5. docs/api/overview-tree.html
6. docs/demo2.html
7. docs/demo4.html
8. docs/api/org/apache/lucene/search/package-summary.html
9. docs/api/org/apache/lucene/search/package-tree.html

SearchFiles prompts interactively with Query:. QueryParser is used  
with Standard-
Analyzer to create a Query. A maximum of 10 hits are shown at a time;  
if there are
more, you can page through them. Press Ctrl-C to exit the program.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org