Created a new clean Scala project using Gradle.
This is the only dependency:
compile "org.scala-lang:scala-library:2.12.4"
When building on the command line ./gradlew build
works perfectly fine. However, when using IntelliJ it gives me this warning:
Error:scalac: 'jvm-1.9' is not a valid choice for '-target'
Error:scalac: bad option: '-target:jvm-1.9'
I have both the JDK with java 8 and 9 installed, but I'm currently using JDK 1.8. But I'm not sure if that's related.
In Scala 2.12, the Scala compiler always compiles to Java 8 compatible bytecode.
You can find more info below:
Add the following lines to your build.gradle:
compileScala.targetCompatibility = 1.8
ScalaCompileOptions.metaClass.useAnt = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With