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
For a Spark project, the IDE created _2.11
versions of SBT modules. I had to delete them by hand.
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.
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
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
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
}
}
Files --> Invalidate caches and restart
.idea
folder (backup runConfigurations
folder if you have one).project.iml
filepom
or from sbt
(or whatever source build tool you have.