Arjan van Wieringen
08/04/2023, 10:29 AM./gradlew build
. Nothing goes wrong with a normal build in IntelliJ. The error I am getting is in my includeBuild("plugins"):
BUILD FAILED in 1s
6 actionable tasks: 3 executed, 3 up-to-date
Arjans-MacBook-Air :: private/kotlin/kotlinx ‹main› » ./gradlew build 1 ↵
> Task :plugins:compileKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':plugins:compileKotlin'.
> Error while evaluating property 'compilerOptions.jvmTarget' of task ':plugins:compileKotlin'.
> Failed to calculate the value of property 'jvmTarget'.
> Unknown Kotlin JVM target: 20
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
In IntlliJ I use JDK 17, of Temurin and everything goes well. Checking ./gradlew --version
I get this:
------------------------------------------------------------
Gradle 8.2.1
------------------------------------------------------------
Build time: 2023-07-10 12:12:35 UTC
Revision: a38ec64d3c4612da9083cc506a1ccb212afeecaa
Kotlin: 1.8.20
Groovy: 3.0.17
Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM: 20.0.1 (Oracle Corporation 20.0.1+9-29)
OS: Mac OS X 13.2.1 aarch64
Should I downgrade Gradle Wrapper again? And... I expected that IntelliJ uses the wrapper, because it is configured like shown in the screenshot.Arjan van Wieringen
08/04/2023, 10:41 AMbuild.gradle.kts
of the plugins
project:
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`kotlin-dsl`
}
dependencies {
implementation(libs.gradle.plugin.jetbrains.kotlin)
implementation(libs.gradle.plugin.jetbrains.serialization)
implementation(libs.gradle.plugin.jetbrains.compose)
}
tasks.withType<JavaCompile> {
targetCompatibility = "19"
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_19)
}
}
Vampire
08/04/2023, 10:57 AMArjan van Wieringen
08/04/2023, 11:31 AMVampire
08/04/2023, 11:32 AM./gradlew --version
say?Arjan van Wieringen
08/04/2023, 12:40 PMArjan van Wieringen
08/04/2023, 12:40 PMVampire
08/04/2023, 12:41 PM