I am trying to use lucene on the Windows' command line as given in this link.
I have created the CLASSPATH variable for all four mentioned .jar
files, but after that, when I run the command:
java org.apache.lucene.demo.IndexFiles -docs C:/lucene/src
it returns the following error:
could not find or load main class org.apache.lucene.demo.IndexFiles
I dont know what's wrong with it... Can anybody help me out? I am a student and just a beginner. Thanks
I ran into a similar issue, you need to include the CLASSPATHs in your command (if its not in environment vars). So it should be:
java -classpath C:\lucene\lucene-5.1.0\core\lucene-core-5.1.0.jar;C:\lucene\lucene-5.1.0\queryparser\lucene-queryparser-5.1.0.jar;C:\lucene\lucene-5.1.0\analysis\common\lucene-analyzers-common-5.1.0.jar;C:\lucene\lucene-5.1.0\demo\lucene-demo-5.1.0.jar org.apache.lucene.demo.IndexFiles -docs C:\lucene\lucene-5.1.0
And to search, you'd do:
java -classpath C:\lucene\lucene-5.1.0\core\lucene-core-5.1.0.jar;C:\lucene\lucene-5.1.0\queryparser\lucene-queryparser-5.1.0.jar;C:\lucene\lucene-5.1.0\analysis\common\lucene-analyzers-common-5.1.0.jar;C:\lucene\lucene-5.1.0\demo\lucene-demo-5.1.0.jar org.apache.lucene.demo.SearchFiles
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With