If I upgrade a project to Kotlin 2.3.20, when that...
# getting-started
k
If I upgrade a project to Kotlin 2.3.20, when that project currently uses jOOQ and Spring Boot 3, I see that we end up with the project itself using
kotlin-stdlib:2.3.20
but the other dependencies use
kotlin-stdlib-jdk8:1.9.25
and
kotlin-stdlib-jdk7:1.9.25
. The other dependencies also use
kotlin-stdlib:1.9.25
but that gets replaced by
2.3.20
. Would that cause a problem with these different versions?
c
In most cases, it shouldn't, because the standard library rarely does binary-incompatible changes.
r
I've been trying to keep everything in line with this:
Copy code
dependencies {
  implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.3.20"))
}
thank you color 1
c
You can ask Gradle what it uses with
Copy code
./gradlew :<your-project>:dependencyInsight --configuration runtimeClasspath --dependency org.jetbrains.kotlin:kotlin-stdlib
thank you color 1
e
I think you may run into issues if kotlin-reflect version is too far out of sync
nothing should need kotlin-stdlib-jdk7/8 anymore since all the jdk7/8-specific classes and functions got moved into main stdlib after Kotlin updated to targeting a minimum of Java 8, so having those at very old versions might result in duplicate class errors. but if you're not running into that, you're probably fine
k
Thanks. The following shows what I'm talking about: project is using Kotlin 2.3.20 with Spring Boot 3, Spring Boot 3 pulls in Kotlin 1.9.25 which is replaced by 2.3.20 from the project, but still using 1.9.25 for the jdk7/8-specific classes because the project doesn't have them as dependencies (it currently just uses kotlin-stdlib instead of kotlin-bom)
Copy code
+--- org.springframework.boot:spring-boot-dependencies:3.5.13
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.25 -> 2.3.20 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.25 (c)
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.25 (c)
|    +--- org.jetbrains.kotlin:kotlin-reflect:1.9.25 -> 2.3.20 (c)