Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'm trying to compile a mixed java-scala code using intelliJ 14.1.4
but it keeps giving me this error:
Error Compiling SBT component 'compiler-interface-2.9.2-52.0'
I have tried to down grade my scala-compiler version but this didn't helped.
any help would be appreciated.
–
–
–
To add to Amy's and other answers, there are three places where JDK is involved. The first two are in the Project Settings, the third is
Settings -> Build, Execution, Deployment -> Compiler -> Scala Compiler -> Scala Compile Server (if enabled).
If this problem arises, check these three are the same.
–
–
Make sure you have the JDK-1.8 set in the following places.
Project Settings -> Project -> Project SDK
Project Settings -> Modules -> Dependencies -> Module SDK
Add/Select JDK-1.8 in
Project Settings -> SDKs
Make sure you have the JDK-1.8 set in the following places.
Project Settings -> Project -> Project SDK
Project Settings -> Modules -> Dependencies -> Module SDK
Add/Select JDK-1.8 in
Project Settings -> SDKs
The first two are in the Project Settings, the third is Settings -> Build, Execution, Deployment -> Compiler -> Scala Compiler -> Scala Compile Server (if enabled). If this problem arises, check these three are the same.
Make Sure that Java versions are same every where,
Solved.
The issue was due to 2 different dependencies, which imported 2 different scala versions, and then scala 2.11 was compiled with scala 2.9 which led to the error.
maven dependencyManagement solved it for me
–
Also, please make sure you are using compatible Scala and Jdk version. like -
JDK-Scala Version compatibility table
Please refer - https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html
I met the same error when I run the old project https://github.com/dpp/simply_lift
it was from 2010.. I must revert my java to 1.7 and update the Scala version from 2.11.6 to 2.11.12 , add it to Project Settings-> Modules
Then I can start the project ...
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.