Intellij compile failures: “is already defined as”

后端 未结 10 1756
北海茫月
北海茫月 2021-02-03 17:14

I\'ve got a scala project that compiles, runs and tests fine when using SBT from the command line. However, when building the project in intellij, it seems every class in the pr

10条回答
  •  逝去的感伤
    2021-02-03 17:44

    It means there are two compiled classes with identical package and class name found in your classpath. One compiled by sbt, one compiled by IntelliJ.

    One of the following should be able to solve the issue:

    1. try to generate IntelliJ .iml file with sbt-idea rather than import directly.
    2. sbt clean before click Build -> Rebuild in IntelliJ
    3. when rebuilding with IntelliJ, make sure sbt is not running

提交回复
热议问题