Scala, Gradle and Java 1.8 problem Follow
Hi,
I'm currently using Gradle to build a project with a mix of Scala and
Java code.
The Gradle import has been working really well in IDEA 13.1 and 14 EAP.
But I've just upgraded to Java 8 and come across a problem.
The Scala facet is created with "Additional compiler options" set to:
-target:jvm-1.8
But 1.8 is not a valid for the Scala compiler (at least not in Scala
2.10.4) and so the build fails.
I have to edit the options to -target:jvm-1.7 each time the Gradle file
is reimported.
So this is definitely a bug but I'm not sure where.
I guess this is actually a Gradle integration problem but thought I'd
check here first.
Thanks,
Steve.
Please sign in to leave a comment.
Hi,
try to add the following line into your build.gradle script for the project:
compileScala.targetCompatibility = "1.7"
see details at http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.scala.ScalaCompile.html#org.gradle.api.tasks.scala.ScalaCompile:targetCompatibility
I actually added it in this form as that's how I've changed other Scala
compilation settings to ensure they happen to both code and test
compilation.
tasks.withType(ScalaCompile) {
targetCompatibility = "1.7"
}
But with that importing works fine.
Thanks.
On 19/09/2014 17:31, Vladislav Soroka wrote:
>
>
>