Eugen Martynov
12/01/2023, 9:11 AMCannot access 'java.io.Serializable' which is a supertype of 'kotlin.String'. Check your module classpath for missing or conflicting dependencies
I have jvm module with kotlin plugin and std lib is added by default. What do I miss in my gradle?Eugen Martynov
12/01/2023, 9:15 AMCLOVIS
12/01/2023, 10:18 AMsettings.gradle.kts
add:
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}
In all your build.gradle.kts
files that have the Kotlin plugin, add:
kotlin {
jvmToolchain(17) // or any other version
}
This way, when you open the repository, Gradle will automatically download that version of the JDK and use it. It automatically sets sourceCompatibility
etc.Eugen Martynov
12/01/2023, 10:58 AMmbonnin
12/02/2023, 3:00 PMrt.jar
that is in the compileClasspath, right? I wish this could work without toolchains. I don't want to download N toolchains for N projects if I have Java 21 installed locallyCLOVIS
12/02/2023, 3:10 PMCLOVIS
12/02/2023, 3:11 PMCLOVIS
12/02/2023, 3:12 PMmbonnin
12/02/2023, 3:15 PMcompileJava
, others?) depend on the JDK version when it really should not be the case. Whether I run my Java8 bytecode on JDK8 or JDK21 should be irrelevant I think?CLOVIS
12/02/2023, 3:16 PMmbonnin
12/02/2023, 3:16 PMoptions.release()
for that I think?mbonnin
12/02/2023, 3:17 PMrt.jar
without downloading all of the JDK, like it's doing for kotlin-stdlib
CLOVIS
12/02/2023, 3:18 PMmbonnin
12/02/2023, 3:19 PMmbonnin
12/02/2023, 3:22 PMCLOVIS
12/02/2023, 3:23 PMmbonnin
12/02/2023, 3:24 PMCLOVIS
12/02/2023, 3:24 PMCLOVIS
12/02/2023, 3:26 PMmbonnin
12/02/2023, 3:26 PMmbonnin
12/02/2023, 3:27 PMmbonnin
12/02/2023, 3:27 PMmbonnin
12/02/2023, 3:28 PMCLOVIS
12/02/2023, 3:28 PMmbonnin
12/02/2023, 3:29 PMmbonnin
12/02/2023, 3:29 PMEugen Martynov
12/02/2023, 3:29 PMCLOVIS
12/02/2023, 3:30 PMEugen Martynov
12/02/2023, 3:31 PMCLOVIS
12/02/2023, 3:31 PMmbonnin
12/02/2023, 3:31 PMmbonnin
12/02/2023, 3:31 PMcompileJava
? I have no clueCLOVIS
12/02/2023, 3:32 PMEugen Martynov
12/02/2023, 3:33 PMCLOVIS
12/02/2023, 3:33 PMstrong use case for that besides the legacy projects
And the opposite: projects that require a min JDK higher than what the user has.
CLOVIS
12/02/2023, 3:34 PMmbonnin
12/02/2023, 3:34 PMEugen Martynov
12/02/2023, 3:36 PMCLOVIS
12/02/2023, 4:00 PMCLOVIS
12/02/2023, 4:01 PM