Not sure if this is an issue with the Kotlin plugi...
# gradle
b
Not sure if this is an issue with the Kotlin plugin, or the Gradle Kotlin DSL, or something I'm doing wrong. Any ideas?
n
Append the following to the build file:
Copy code
val compileKotlin by tasks.getting(KotlinCompile::class) {
    kotlinOptions.jvmTarget = "1.8"
}
val compileTestKotlin by tasks.getting(KotlinCompile::class) {
    kotlinOptions.jvmTarget = "1.8"
}
Refresh Gradle in Intellij.
Works with Gradle 4.4 ☝️. Which version of Gradle are you using?
If all else fails try invalidating the Gradle build cache. In Intellij press Ctrl+Shift+a, enter in invalidate Gradle, select the first option, and click on the restart button.
b
That worked, thanks! Did they change the task configuration syntax again? Seems pretty verbose. I'm using the
gradle-4.4-all
distribution.
i
@breandan The way you originally configured kotlin options to target jvm 1.8 should be enough. If these options aren't imported in IDE properly, please report a bug.
b
Think it was a stale cache, had to delete the
.idea
folder and
.iml
files and reimport the project from scratch. Thanks!