Output path is shared between the same module error

后端 未结 13 2103
天涯浪人
天涯浪人 2021-02-01 13:16

When I try to compile any class in my project I get the error below:

Error scala: Output path .../eval/target/test-classes is shared between: Module \'eval\' tes         


        
相关标签:
13条回答
  • 2021-02-01 13:18

    For a Spark project, the IDE created _2.11 versions of SBT modules. I had to delete them by hand.

    0 讨论(0)
  • 2021-02-01 13:19

    Problem solved!

    I have reset backward and forward my git repository many times and close-reopen idea after some of it. When finaly IDEA shows a red message at the right top while it was starting. It says something like: the project has already a eval module, and if I want to delete eval module. Yes, it was quite confusing, but I click on delete and my problem disappear. I guess that for some reason I become with 2 eval modules and it delete one of it solving output path error.

    0 讨论(0)
  • 2021-02-01 13:19

    I had 2 differently named versions of the same module and needed to delete one to avoid this clash. This is what worked for me:

    In IntelliJ IDEA go to File -> Project Structure -> Modules -> Your Project -> Paths

    Ensure each Modules "Output path" and "Test output path" locations are unique across all your modules. If you have more than one module with the same paths, you can specify unique paths for every module or as in my case, delete the module that you do not require as it was a duplicate of an existing module

    0 讨论(0)
  • 2021-02-01 13:20

    Set up the output paths for your modules to different directories, as explained here: https://www.jetbrains.com/idea/help/configuring-module-compiler-output.html

    On Project "Open Module Settings" -> Modules -> Paths -> Output/Test path

    0 讨论(0)
  • 2021-02-01 13:20

    This is really a response to @habitat's comment on @Corey Klein 's answer. If someone with enough reputation wants to edit, please go ahead...

    I had the same problem with the setting being reset every time I refreshed the project. My solution (with Gradle, although I'm guessing there is an equivalent Maven plugin) was to add

    apply plugin: 'idea'
    idea {
        module {
            inheritOutputDirs = true
        }
    }
    
    0 讨论(0)
  • 2021-02-01 13:23
    1. Files --> Invalidate caches and restart
    2. Close intellij
    3. delete (extenrally from intellij) .idea folder (backup runConfigurations folder if you have one).
    4. delete the project.iml file
    5. Open intellij
    6. Open the project again from pom or from sbt (or whatever source build tool you have.
    0 讨论(0)
提交回复
热议问题