Take the 2-minute tour ×
String usage = "IndexHTML [-create] [-index <index>] <root_directory>";

What does this line do in my IndexHTML.java file?

share|improve this question
Don't know either. What does IndexHTML.java ? –  Twister Feb 10 '11 at 12:50
Shouldn't you be the one to tell us? Is it not your indexHTML.java? –  gabuzo Feb 10 '11 at 12:51
add comment

2 Answers

It defines either a local variable or a field (depending on its location) named usage of type String with the value "IndexHTML [-create] [-index <index>] <root_directory>".

It looks like it's meant for a short error/help message about how to run the class. It means that the class (when started from the command line) takes an optional -create flag, an optional -index option with an argument and that you need to specify the root directory.

share|improve this answer
+1 for a thoroughly complete answer –  darioo Feb 10 '11 at 13:02
I am told in my lucene demo to run the following command on the command line "java org.apach.apache.lucene.demo.IndexHTML -creat -index /usr/local/lib ..", but it always brings me a NoClassDeffoundError: Exception in thread "main" java.lang.NoClassDefFoundError: org/apach/apache/lucene/demo/IndexHTML Caused by: java.lang.ClassNotFoundException: org.apach.apache.lucene.demo.IndexHTML at java.net.URLClassLoader$1.run(URLClassLoader.java:202) java.net.URLClassLoader.findClass(URLClassLoader.java:19)... at java.lang.ClassLoader.loadClass(ClassLoader.java:248) –  Phil Hunter Feb 10 '11 at 15:42
@user544006: that means that the class is not on your classpath. –  Joachim Sauer Feb 10 '11 at 15:53
How do i get the class on my classpath? In the tutorial it asks me to create classpaths to the jar files which i have done using this command: CLASSPATH=${CLASSPATH}:/Users/philhunter/Desktop/COM562\ Project/lucene-3.0.3/lucene-core-3.0.3.jar. The demo does not mention creating classpaths to that online file (org.apach.apache.lucene.demo.IndexHTML) which i used in the demo. –  Phil Hunter Feb 10 '11 at 15:58
I tried CLASSPATH=${CLASSPATH}:org.apach.apache.lucene.demo.IndexHTML, but im still getting ClassNotFoundException –  Phil Hunter Feb 10 '11 at 16:24
show 7 more comments

If you search around you will find also an if checking the contents and size of your args array.

share|improve this answer
add comment

Your Answer


