Hi have a multi module project that uses Koltin + ...
# gradle
p
Hi have a multi module project that uses Koltin + Spring and Kotlin React. After migrating from JS to MULTIPLATFROM I noticed IDE made changes as follows 1. removed java.sourceCompatibility = JavaVersion.VERSION_17 2. added
Copy code
kotlin {
    jvmToolchain(17)
}
3. Added
Copy code
implementation(kotlin("stdlib-jdk8"))
Is this a new recommended way things need to be defined??? Or is IntelliJ being optimistic ??? I been using JDK 17 with Kotlin.. .and things like Colection.stream were available without
stdlib-jdk8
defined???
v
Replacing
...Compatibility
by toolchains is imho always a good idea. 3. I'd say should not be necessary. Long ago you needed stdlib defined yourself, but since quite some time KGP should automatically add it for you, so I'd wonder why it should be added explicitly.
p
Great Thank you! this helps!
And regarding 3. This was exactly why I didn't include it before...
v
Maybe someone is going to correct me, but I'd say just ditch it and if everything works, it's still fine to not have it. 😄
And regarding the toolchains you can also have a look at https://blog.jetbrains.com/kotlin/2021/11/gradle-jvm-toolchain-support-in-the-kotlin-plugin/ for example
✅ 1
💯 1