I'm trying to get the Kotlin compiler to generate Java 1.8 bytecode instead of 1.6 bytecode. Both the official docs and this StackOverflow question say you need to use code like this:
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
However, when I add this to my Gradle configuration, IntelliJ tells me that the symbol kotlinOptions cannot be resolved. Why is this? I'm using Kotlin v1.2.0, and it can compile code just fine, but it can't set this option.
As @Mikezx6r explained, the option is there otherwise it wouldn't compile. It's just that IntelliJ does not see this. Note that the 'Cannot resolve symbol' inspection does not generate any error, warning or even typo, it only greys out the option.
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