0

I'm working on a Java project with Maven, and I need the Weka 3.8.5 dependency.

That's why I added in my pom:

<dependency>
   <groupId>nz.ac.waikato.cms.weka</groupId>
   <artifactId>weka-stable</artifactId>
   <version>3.8.5</version>
</dependency>

When I try to run, I get the following:

Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for /home/user/.m2/repository/com/github/vbmacher/java-cup/11b-20160615/java-cup-11b-20160615.jar
Caused by: java.lang.IllegalArgumentException: java.cup.11b: Invalid module name: '11b' is not a Java identifier

I found that the problems are due to "-" char, which is not a java char. I'm currently using a module-info.java file.

Is there a way to use this dependency?

Edit:

As Mark said in comment, it works removing the module-info.java file. In order to learn something, can anyone explain me why this solution works?

ma4strong
  • 300
  • 2
  • 8
  • 2
    First if you use modules (module-info.java) all your parts have to have correct module names. I would create an issue at the author of the module to provide at least an automatic module name... Apart from that the dependency you are showing seemed to be not the culprit. `com/github/vbmacher/java-cup/11b-20160615/java-cup-11b-20160615.jar` this one is the problem.... – khmarbaise Jul 03 '21 at 12:27
  • I'm pretty sure it is this dependency: using version 3.6.6 there aren't problems and the code works properly. What I tried is to comment out the 3.8.5 version and using the 3.6.6 and no other change is made. – ma4strong Jul 03 '21 at 14:01
  • The quickest fix is to switch to a non-modular project (i.e. remove module-info.java). – Mark Rotteveel Jul 03 '21 at 15:50
  • it works, but i really can't understand this. I really want to understand it, so i will edit the question. Thanks a lot!! – ma4strong Jul 03 '21 at 17:13
  • The problem is simply that the dependency nz.ac.waikato.cms.weka contains itself a dependency which is causing the issue. This is one of the bigger challenges to accept modules. All dependencies must be modules... – khmarbaise Jul 03 '21 at 20:42

0 Answers0