OjWej, what have I done wrong this time? :cry: ```...
# coroutines
a
OjWej, what have I done wrong this time? 😢
Copy code
java.lang.NoClassDefFoundError: kotlin/coroutines/AbstractCoroutineContextKey
I thought adding kotlinx-coroutines-core to my pom.xml would be enough...? kotlin: 1.3.72 kotlinx-coroutines-core: 1.3.7 - Also tried it with 1.3.5: Same result...
g
looks that you don’t have stdlib (or your stdblib is too old)
a
Hello Andrey I'm using kotlin-stdlib-jdk8 in version 1.3.72. Will chekc if there is a more recent version. Thanks! Best regards Alex
g
no 1.3.72 should be enough
maybe you have something like old kotlin-stdlib (which overrides jdk8 transitive dependecy)
kotlin-stdlib-jdk8 itself is a very small artifact which provides a few classes for Java 8 support, but it itself has kotlin-stdlib in dependencies
also, check that you don’t have
kotlin-stdlib-jre8
this is old name of the same artifact which existed before Kotlin 1.2, so it may also bring old stdlib to classpath and I not sure how maven dependency resolution will work in this case
a
Hello Andrey Thanks for your help but just foget it: I'm as dumb as I'm tall... 🤪 I've fogotten to include kotlin-stdlib in my dependency-list... How embarrassing... 🙁 Best regards Alex
g
kotlin-stdlib should be transitively added by kotlin-stdlib-jdk8, but again not very familiar with maven
a
Yes, that's what puzzles me a little bit: The transitively added dependencies should be added to the class-path. I've added the dependency to my pom.xml explicitly now. And - Surprise! - it works like expected. Funny.
g
That what I’m saying, maybe it was overwritten by another depedency, because in maven not always the nevest version is used (at least as I know), dependency resolution is different