Static methods in interface require -target:jvm-1.8

Ok, after struggling with this problem for a few weeks and decided to post on SO, I try to fiddle further more with gradle, I finally managed to fix this problem.

Turns out that I have to add these two lines to gradle

project.tasks.compileScala.scalaCompileOptions.additionalParameters = ["-target:jvm-1.8"] project.tasks.compileTestScala.scalaCompileOptions.additionalParameters = ["-target:jvm-1.8"]

This is fixing the issue and it doesn't come back.


An addition to @Wins answer for those using maven with scala-maven-plugin. You need to add the following line to plugin configuration:

<addScalacArgs>-target:jvm-1.8</addScalacArgs>

Tags:

Scala

Gradle