0

I downloaded OpenJDK11 source code and tried to set it up in Intellij IDEA(version 2022.1.3) with JDK correto-11.

When I build the project, an error says: "java: package exists in another module: java.base" as shown below.

Does anyone have any idea how to fix it? Thanks a lot.

enter image description here

aqingsao
  • 2,104
  • 1
  • 19
  • 18

1 Answers1

0

I often fix this by deleting the conflicting module. Usually it's brought in as a transitive dependency.

In my case, my main package uses JDK11, but the transitive dependency uses JDK8 and bundled some Java8 source code into itself. Furthermore, it was unused because that library only contained some model code.

In my case, it's usually something like generated-src/java.base or generated-src/java.time

TL;DR = try deleting that src/java.base and see if IntelliJ will happily build.