Apache Lucene exception java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyze


C:\Users\tunato\Desktop\lucene-5.1.0\lucene-5.1.0\demo>java -cp C:\Users\tunato\Desktop\lucene-5.1.0\lucene-5.
1.0\core\lucene-core-5.1.0.jar;C:\Users\tunato\Desktop\lucene-5.1.0\lucene-5.1.0\demo\lucene-demo-5.1.0.jar or
g.apache.lucene.demo.IndexFiles C:\Users\tunato\Desktop\lucene-5.1.0\lucene-5.1.0
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyze
r
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.standard.StandardAnalyzer
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 6 more

C:\Users\tunato\Desktop\lucene-5.1.0\lucene-5.1.0\demo>

You should add the following jar to CLASSPATH
lucene-analyzers-common-5.1.0.jar
C:\Users\tunato\Desktop\lucene-5.1.0\lucene-5.1.0\analysis\common\lucene-analyzers-common-5.1.0.jar

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s