Hi All, tried Kotlin 1.4.0 on existing code (worki...
# eap
r
Hi All, tried Kotlin 1.4.0 on existing code (working in 1.3.72), got this error class instantiation (object), not sure what is the issue or how to debug “Exception in thread “main” java.lang.NoClassDefFoundError: kotlin/KotlinNothingValueException”
g
Looks that you don’t have Kotlin Stdlib in classpath
r
thanks @gildor it worked
l
How would the stdlib end up missing in the classpath? Are you using Gradle or something else?
n
i had similar issues during the upgrade.. gradle had to be a bit annoying with its caches
u
This problem is possible if the code is compiled with Kotlin compiler 1.4 against stdlib 1.4, but at runtime, there’s only stdlib of earlier version (e.g. 1.3) in the classpath. A workaround is to use
-api-version 1.3
, but that would prevent you from using the new API added in kotlin-stdlib 1.4.
l
How would it go missing from the runtime classpath but available at compile time unless
compileOnly
is used?
🤷 1
r
it was in a mix Java project, so it’s didn’t like the java path anymore, changing to kotlin directory fixed it.
g
Do you mean src/main/java vs src/main/Kotlin source sets?
r
yes