hi- in my java project with gradle `6.8.3`, I’m ge...
# announcements
s
hi- in my java project with gradle
6.8.3
, I’m getting nagged on kotlin
1.4.20
vs
1.4.30
— I’m going to downgrade to kotlin-1.4.20 everywhere, is there a better solution?
no dice, leaving this here in case anyone has an idea - thank you
Copy code
> Task :compileTestKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /home/runner/.gradle/wrapper/dists/gradle-6.8.3-bin/7ykxq50lst7lb7wx1nijpicxn/gradle-6.8.3/lib/kotlin-stdlib-1.4.20.jar (version 1.4)
    /home/runner/.gradle/wrapper/dists/gradle-6.8.3-bin/7ykxq50lst7lb7wx1nijpicxn/gradle-6.8.3/lib/kotlin-stdlib-common-1.4.20.jar (version 1.4)
    /home/runner/.gradle/wrapper/dists/gradle-6.8.3-bin/7ykxq50lst7lb7wx1nijpicxn/gradle-6.8.3/lib/kotlin-stdlib-jdk7-1.4.20.jar (version 1.4)
    /home/runner/.gradle/wrapper/dists/gradle-6.8.3-bin/7ykxq50lst7lb7wx1nijpicxn/gradle-6.8.3/lib/kotlin-stdlib-jdk8-1.4.20.jar (version 1.4)
    /home/runner/.gradle/wrapper/dists/gradle-6.8.3-bin/7ykxq50lst7lb7wx1nijpicxn/gradle-6.8.3/lib/kotlin-reflect-1.4.20.jar (version 1.4)
    /home/runner/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.30/a9116fbe28a0514671787df95133f28e65fdac25/kotlin-reflect-1.4.30.jar (version 1.4)
    /home/runner/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.72/916d54b9eb6442b615e6f1488978f551c0674720/kotlin-stdlib-jdk8-1.3.72.jar (version 1.3)
    /home/runner/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.72/3adfc2f4ea4243e01204be8081fe63bde6b12815/kotlin-stdlib-jdk7-1.3.72.jar (version 1.3)
    /home/runner/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.30/d10d1e10f47006ee08162dde039e38ac487de4ac/kotlin-stdlib-1.4.30.jar (version 1.4)
    /home/runner/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.30/bb9a3173350f55732416ee27956ea8f9b81f4dbb/kotlin-stdlib-common-1.4.30.jar (version 1.4)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
e
try using the BOM to align versions
Copy code
dependencies {
    implementation(platform(kotlin("bom")))
}
and read the Gradle documentation to decide if you want to use
platform()
or
enforcedPlatform()
Copy code
dependencies {
    implementation platform("org.jetbrains.kotlin:kotlin-bom:$kotlinVersion")
}
or something like that if you're still using the Groovy DSL
t
You seem to mixing 1.4.30 with
stdlib
1.3.72
Copy code
kotlin-stdlib-jdk7-1.3.72.jar 
kotlin-stdlib-jdk8-1.3.72.jar
Simply remove the stdlib dependency, the Kotlin Gradle plugin includes it automatically. https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library
s
ah- Thank you @Tom Hermann — trying removing
stdlib
👍 1
😞
woohoo!
actually worked! had to
./gradlew clean
first 🙂
👌 1
simply had to remove
stdlib
,
-reflect
from
dependencies { }