Hi I want to compile java code in the terminal I enter the below command in terminal
javac -cp .:../../lucene-8.6.3/lucene-8.6.3/core/lucene-core-8.6.3.jar:../../lucene-8.6.3/lucene-8.6.3/analysis/common/lucene-analyzers-common-8.6.3.jar:../../lucene-8.6.3/lucene-8.6.3/queryparser/lucene-queryparser-8.6.3.jar IndexFiles.java
and i dont get any error, and after i enter below command to run:
java -cp .:../../lucene-8.6.3/lucene-8.6.3/core/lucene-core-8.6.3.jar:../../lucene-8.6.3/lucene-8.6.3/analysis/common/lucene-analyzers-common-8.6.3.jar:../../lucene-8.6.3/lucene-8.6.3/queryparser/lucene-queryparser-8.6.3.jar IndexFiles
but I get this error:
Error: Could not find or load main class IndexFiles
Caused by: java.lang.NoClassDefFoundError: lucene/IndexFiles (wrong name: IndexFiles)
what should I do? and what is my wrong?
and this is IndexFiles class
package lucene;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.*;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.index.Term;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Date;
/** Index all text files under a directory.
* <p>
* This is a command-line application demonstrating simple Lucene indexing.
* Run it with no command-line arguments for usage information.
*/
public class IndexFiles {
....