I've updated all my dependencies in my project and...
# gradle
a
I've updated all my dependencies in my project and updated the Gradle distribution to 8.2.1., however I now get errors when building via
./gradlew build
. Nothing goes wrong with a normal build in IntelliJ. The error I am getting is in my includeBuild("plugins"):
Copy code
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:
Copy code
------------------------------------------------------------
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.
This appears to work in the
build.gradle.kts
of the
plugins
project:
Copy code
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)
    }
}
v
Don't run Gradle with an unsupported Java version: https://docs.gradle.org/current/userguide/compatibility.html
a
But I haven’t? I updated Gradle and then this came. I did not use Java 20.
v
What does
./gradlew --version
say?
a
Apparently there is a 20 version on my mac. Which is strange. I haven't installed any. I was confused, I thought it was a JDK Gradle shipped with and as such was confused that 20 was not allowed
Thanks for the help!
👌 1
v
Gradle never ships any Java version