Which standard library to use in Kotlin

前端 未结 3 1353
刺人心
刺人心 2021-02-13 05:41

In Kotlin, when working with the JVM, it seems there is multiple choices for standard library, namely kotlin-stdlib, kotlin-stdlib-jdk7 and kotli

3条回答
  •  孤城傲影
    2021-02-13 06:19

    By running Gradle dependencies task in your Kotlin project, you can find some useful information. This is a part of output in a sample project:

    $ ./gradlew dependencies
    
    ...
    
    kotlinCompilerClasspath
    \--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.20
         +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.20
         |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.20
         |    \--- org.jetbrains:annotations:13.0
         +--- org.jetbrains.kotlin:kotlin-script-runtime:1.3.20
         +--- org.jetbrains.kotlin:kotlin-reflect:1.3.20
         |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.20 (*)
         \--- org.jetbrains.intellij.deps:trove4j:1.0.20181211
    
    ...
    

提交回复
热议问题