Why is there no kotlin-stdlib-jdk11?

Viewed 15804

I'm using Kotlin for backend development...

Is it because Kotlin 1.4 already supports it? Or kotlin-stdlib-jdk8 would suffice? Or Kotlin does not have plans to support JDK 11?

Please enlighten me.

Thanks!

1 Answers

TL;DR kotlin-stdlib-jdk8 can be successfully used with JDK 11.

The motivation of splitting binaries by JDK 1.7 and JDK 1.8 is the dependency of the jdk8 artifact on some APIs not available (e.g., ThreadLocalRandom) in older Java versions.

Currently, there is no need for a special standard library artifact for JDK 11 because Kotlin doesn't provide any APIs depending on it.

Update: just in case, if you use Kotlin Gradle Plugin, you don't need to specify Kotlin's standard library dependency manually since the plugin adds it to all the Kotlin source sets automatically.

Related