Updating SBT project in Intellij Idea switches Java to 7

I had a Play 2.4.2 scala project built with J7 in IntelliJ Idea, then I switched the project to Play 2.5.0 with J8. I changed J7-> J8 everywhere I could think of, but for some reason, when I update a project in a SBT projectswindow in Intellij Idea (and it also updates it automatically when build.sbt changes), it sets the Java version back to 7 (both parameters Project SDKand Project language level:in are Project Structureset back)

I probably missed some option, but I can't find anything else that points to J7. Any idea?

I tried putting this in build.sbt, but this did not fix the problem:

scalacOptions ++= Seq("-target:jvm-1.8")

Sbt compiles the project perfectly if it compiled an SBT terminal, but I prefer to use the IntelliJ Idea launch option.

+4
source share
2 answers

We are studying this. Meanwhile, one way is to edit .idea/sbt.xmland change the options line jdkto <option name="jdk" value="1.8" />(or whatever you called the SDK in the project structure), and then update the project.

Update: The latest Scala plugin nightclubs change the way you create a JDK project that should enable this.

+2
source

All Articles