https://kotlinlang.org logo
Title
x

xenoterracide

12/14/2018, 6:54 PM
dependencies {
    compile(kotlin("stdlib", "1.3.11"))
}
w: Runtime JAR files in the classpath have the version 1.2, which is older than the API version 1.3. Consider using the runtime of version 1.3, or pass '-api-version 1.2' explicitly to restrict the available APIs to the runtime of version 1.2. You can also pass '-language-version 1.2' instead, which will restrict not only the APIs to the specified version, but also the language features
w: /tmp/.gradle-test-kit-xeno/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.2.71/ba18ca1aa0e40eb6f1865b324af2f4cbb691c1ec/kotlin-stdlib-common-1.2.71.jar: Runtime JAR file has version 1.2 which is older than required for API version 1.3
w: /tmp/.gradle-test-kit-xeno/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.71/d9717625bb3c731561251f8dd2c67a1011d6764c/kotlin-stdlib-1.2.71.jar: Runtime JAR file has version 1.2 which is older than required for API version 1.3
e: /tmp/junit14078856699846774951/junit17290987759747338376/src/main/kotlin/com/xenoterracide/test/Test.kts: (17, 1): Cannot access script base class 'kotlin.script.templates.standard.ScriptTemplateWithArgs'. Check your module classpath for missing or conflicting dependencies
how do I make kotlin 1.3 work? or heck, even 1.2… no matter what I seem to do it seems to end up with this error
g

gildor

12/16/2018, 2:03 AM
Thils is not related on Kotlin version
See, this is some error of Scripting, not version etc (it's just a warning about version, you can ignore it)
I see that you use script (kts) instead of regular Kotlin file (kt) is that intentionally? If you use kt everything should work. If you have some script based test runner, I believe you need jar with ScriptDefinition to make it work
x

xenoterracide

12/16/2018, 2:23 AM
actually when I figured it out, it's because spring boot (having 1.2 forced with gradle having 1.3?), also the kts thing that you mentioned... got used to typing kts with gradle scripts
g

gildor

12/16/2018, 5:56 AM
Yes, for Gradle for sure you need kts, but according to your error message you use kts file in tests