You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/05/25 13:49:57 UTC

[GitHub] [lucene] mocobeta commented on a diff in pull request #923: LUCENE-10200: Correct outdated instruction in the demo tutorial

mocobeta commented on code in PR #923:
URL: https://github.com/apache/lucene/pull/923#discussion_r881678572


##########
lucene/demo/src/java/overview.html:
##########
@@ -49,40 +49,49 @@ <h2 class="boxed">About the Demo</h2>
 demonstrates various functionalities of Lucene and how you can add Lucene to
 your applications.</p>
 </div>
-<a id="Setting_your_CLASSPATH"></a>
-<h2 class="boxed">Setting your CLASSPATH</h2>
+<a id="Setting_your_module_path"></a>
+<h2 class="boxed">Setting your module path (or classpath)</h2>
 <div class="section">
 <p>First, you should <a href=
 "http://www.apache.org/dyn/closer.cgi/lucene/java/">download</a> the latest
 Lucene distribution and then extract it to a working directory.</p>
-<p>You need four JARs: the Lucene JAR, the queryparser JAR, the common analysis JAR, and the Lucene
-demo JAR. You should see the Lucene JAR file in the modules/ directory you created
-when you extracted the archive -- it should be named something like
+<p>You need Lucene demo and a few dependent modules.
+You should see the Lucene modules (JARs) in the modules/ and third party modules in the modules-thirdparty/ directory
+you created when you extracted the archive -- it should be named something like
 <span class="codefrag">lucene-core-{version}.jar</span>. You should also see
 files called <span class="codefrag">lucene-queryparser-{version}.jar</span>,
 <span class=
 "codefrag">lucene-analysis-common-{version}.jar</span> and <span class=
-"codefrag">lucene-demo-{version}.jar</span> under queryparser, analysis/common/ and demo/,
-respectively.</p>
-<p>Put all four of these files in your Java CLASSPATH.</p>
+"codefrag">lucene-demo-{version}.jar</span> under modules directory.</p>
+<p>There are two ways to run Java program: with module path or with classpath. Either way is fine. Put all of these files in your Java module path or classpath.</p>
 </div>
 <a id="Indexing_Files"></a>
 <h2 class="boxed">Indexing Files</h2>
 <div class="section">
 <p>Once you've gotten this far you're probably itching to go. Let's <b>build an
-index!</b> Assuming you've set your CLASSPATH correctly, just type:</p>
+index!</b> Just type either command:</p>
+<p>With module path</p>
 <pre>
-    java org.apache.lucene.demo.IndexFiles -docs {path-to-lucene}
+    java --module-path modules:modules-thirdparty --module org.apache.lucene.demo/org.apache.lucene.demo.IndexFiles -docs {path-to-lucene}
+</pre>
+<p>With classpath</p>
+<pre>
+    java -cp "modules/*:modules-thirdparty/*" org.apache.lucene.demo.IndexFiles -docs {path-to-lucene}

Review Comment:
   It's not a good practice to put all jars into classpath with wildcard at all, however, I don't think we can maintain the correct jar list (it was proved in the latest tutorial - the jar list there had been outdated long before 9.0, and this is another reason why I'd prefer module path).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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