1

I'm currently working on a java project. Every time I try to run the code my IDE (IntelliJ) throws the following error

java: the unnamed module reads package com.graphhopper from both graphhopper.core and graphhopper.web.api

For build and dependency management I use Maven. For a build in openstreetmap routing system, I use GraphHopper. I included it into the pom.xml.

<dependencies>
    <dependency>
        <groupId>com.graphhopper</groupId>
        <artifactId>graphhopper-core</artifactId>
        <version>4.0</version>
    </dependency>
</dependencies>

In the module info I added it as well.

requires graphhopper.web.api;
requires graphhopper.core;

Since it seems to be an IDE problem I don't add the code in the post. Happy to share if needed. Any hints are much appreciated.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Reinhard
  • 11
  • 1
  • Sounds like graphhopper is not modularized, because proper modules cannot have the same package in multiple modules. Consider not using modular Java, and remove the `module-info.java` to use non-modular Java. – Mark Rotteveel Jan 15 '22 at 16:22
  • See https://stackoverflow.com/a/65701282/8203759. Not sure it is an IDE problem. Does the project work from the command line without IDE? – Konstantin Annikov Jan 16 '22 at 12:12
  • See https://github.com/graphhopper/graphhopper/issues/2053 regarding the module-info.java – Karussell Jan 16 '22 at 16:31

0 Answers0