w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Unable to run Java program that imports org.apache.lucene.analysis.Analyzer

Your problem is that when you build the jars of your application, the maven dependences of Lucene (.jar files) are not included in your jars, that is, Java cannot find the Lucene's classes that your application use. I had the same issue with the same stack trace.

You should better use Maven to build your project.

What you have to do, is to build your sources with the dependences and then, your compiled application will include the Lucene's jars.

To do this, just add these lines of code in your .pom file of the Maven project


Now, run your application: hadoop jar APP_NAME-jar-with-dependencies.jar

All the above will resolve your issue.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.