警告:类路径中的 Kotlin 运行时 JAR 文件应该具有相同的版本 [英] warning: Kotlin runtime JAR files in the classpath should have the same version

查看:44
本文介绍了警告:类路径中的 Kotlin 运行时 JAR 文件应该具有相同的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下警告,但我不确定 v1.0.6 所在的位置.

I get the following warning, but I'm not sure where v1.0.6 resides.

这个错误是否可能来自 Kotlin 库,包括旧的 Kotlin 版本?

Is it possible this error comes from a Kotlin library somehow including an old Kotlin version?

任何解决方法的想法,或者至少我如何按照建议使 kotlin-reflect 明确 (1.1) ?

Any ideas how to fix it or at least how can I follow the suggestion to make kotlin-reflect explicit (1.1) ?

推荐答案

看来你的项目配置方式依赖于 kotlin-stdlib 1.1 和 kotlin-reflect 1.0.最可能的情况是您已经显式依赖 kotlin-stdlib 1.1,但不依赖 kotlin-reflect 和其他一些库(您依赖的库)取决于 kotlin-reflect 1.0.

It seems that your project is configured in such a way that you depend on kotlin-stdlib 1.1 and kotlin-reflect 1.0. The most likely case is that you already have an explicit dependency on kotlin-stdlib 1.1 but have no dependency on kotlin-reflect, and some other library (which you depend on) depends on kotlin-reflect 1.0.

如果确实如此,解决方案是提供对 kotlin-reflect 1.1 的显式依赖.

If that indeed is the case, the solution is to provide an explicit dependency on kotlin-reflect 1.1.

在 Maven 中,将其添加到 pom.xml:

In Maven, add this to pom.xml:

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>1.1.0</version>
        </dependency>
    </dependencies>

在 Gradle 中,将其添加到 build.gradle:

In Gradle, add this to build.gradle:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-reflect:1.1.0"
}

在官方文档中查看有关此和相关警告的一些信息.

See some info about this and related warnings in the official docs.

这篇关于警告:类路径中的 Kotlin 运行时 JAR 文件应该具有相同的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆