https://kotlinlang.org logo
Title
d

darych

03/14/2019, 2:33 PM
Hi all. Could somebody explain why I get this message during Maven build:
[WARNING] Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    C:/Users/somebody/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.jar (version 1.3)
    C:/Users/somebody/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.2.41/kotlin-stdlib-1.2.41.jar (version 1.2)
    C:/Users/somebody/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.41/kotlin-stdlib-jdk7-1.2.41.jar (version 1.2)
[WARNING] Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
In Maven dependencies I see only this with 1.2.41 version:
[INFO] +- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.3.21:compile
[INFO] |  +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.2.41:compile
[INFO] |  |  \- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.2.41:compile
Interesting. It looks like if I use
kotlin-stdlib
instead of
kotlin-stdlib-jdk8
there is no dependency on kotlin 1.2.41
But now IDEA says that Kotlin is not configured. If I choose "Koltin with Java" it adds
kotlin-stdlib-jdk8
again
@ilya.gorbunov Maybe you can help me please. Why
kotlin-stdlib-jdk8
transitively use
kotlin-stdlib
version 1.2.41? If it's necessary, maybe warning should be removed?
i

ilya.gorbunov

03/14/2019, 4:24 PM
Perhaps these 1.2.41 versions of
kotlin-stdlib
and
kotlin-stdlib-jdk7
are brought transitively by some other dependency? Or their versions are specified in the
dependencyManagement
section explicitly or with some BOM import?
d

darych

03/14/2019, 5:20 PM
Will check it tomorrow once more. But when I ran Maven dependency:tree I saw kotlin 1.2.41 only under kotlin-stdlib-jdk8. Also I will check kotlin-test (I think it was used in project).
@ilya.gorbunov I verified everything again. Maven Dependency where I found 1.2.41:
[INFO] +- org.jetbrains.kotlin:kotlin-test:jar:1.3.21:test
[INFO] |  +- org.jetbrains.kotlin:kotlin-test-common:jar:1.3.21:test
[INFO] |  |  \- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.3.21:test
[INFO] |  \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.2.41:compile
[INFO] |     \- org.jetbrains:annotations:jar:13.0:compile
[INFO] +- org.mockito:mockito-core:jar:2.15.0:test
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.7.11:test
[INFO] |  +- net.bytebuddy:byte-buddy-agent:jar:1.7.11:test
[INFO] |  \- org.objenesis:objenesis:jar:2.6:test
[INFO] +- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.3.21:compile
[INFO] |  \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.2.41:compile
Dependencies declaration:
<kotlin.version>1.3.21</kotlin.version>
....
<dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-test</artifactId>
      <version>${kotlin.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
      <version>${kotlin.version}</version>
    </dependency>