0

I installed Lucene v8.11.1 and tried to run it on Eclipse. I followed all the instructions from the original resource: LuceneTutorial.com. I installed the jar files, required to function Lucene, into my project as external libraries. Finally I took the example from the website to use it, but it gives me this error when I import the StandardAnalyzer class: "The package org.apache.lucene.analysis.standard is accessible from more than one module: lucene.analyzers.common, lucene.core"

Lucene program in Eclipse Shows an error of one package is accessible from two different modules

Apparently, Eclipse cannot tell from which module I am importing this class.

I looked for a solution to this issue, but could not found I any solution that fit my problem. Same problem other people have mentioned but none of which solve my problem:

a. a question on StackOVerFlow

b. MarkLogic website

c. Other question on StackOverFlow

Any help is appreciated. Thanks in advance

bakursait
  • 49
  • 1
  • 8
  • 1
    The error message `The package org.apache.lucene.analysis.standard is accessible from more than one module: lucene.analyzers.common, lucene.core` means you have the modules `lucene.analyzers.common` and `lucene.core` on the modulepath (_Project > Properties: Java Build Path_ tab _Libraries_) which both contains the package `org.apache.lucene.analysis.standard` and this is illegal in Java 9 or higher. Delete your `module-info.java` file and move the libraries from the modulepath to the classpath. – howlger Feb 16 '22 at 20:13
  • @howlger That solved the problem. Thanks a lot. One of the posts for the same problem has suggested to Delete the module file. I did that, but the error is still there. You gave more details about it.. Thanks again. – bakursait Feb 17 '22 at 01:14
  • For more details see https://stackoverflow.com/a/53824670/6505250 – howlger Feb 17 '22 at 07:35

0 Answers0