I haven't touched coroutines in a while. `runBlock...
# coroutines
s
I haven't touched coroutines in a while.
runBlocking
is now showing a
deprecated
warning, but I can find no information about this anywhere on the internet, not even the actual documentation https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/run-blocking.html. Anyone know what is up with
runBlocking
? What will it be in 1.4?
o
I've not seen a depreciation warning for it, what does the full message say?
s
message has been deleted
o
you imported the wrong
runBlocking
it's from the old experimental coroutines package
s
Hm. Apparently I was depending on
org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:jar:1.3.3
and it depends on
org.jetbrains.kotlinx:kotlinx-coroutines-core:jar:0.22
I added an explicit dependency on the correct coroutines core jar and it works now. thanks.
hmm. switching to that fixed the deprecation, but now I get an actual error running tests...
Copy code
java.lang.NoClassDefFoundError: kotlinx/coroutines/BuildersKt
o
I'm surprised when you say that -jdk8 pulls in 0.22
the POM is quite clear: https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-jdk8/1.3.3/kotlinx-coroutines-jdk8-1.3.3.pom
Copy code
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<version>1.3.3</version>
<scope>compile</scope>
</dependency>
s
yeah idk. i ran
mvn dependency:tree
and that's what I got.
super strange.
o
perhaps -jdk8 is being pulled to a lower version for some reason?
that's probably the fix you'll need, is whatever fixes this dependency issue
not familiar enough with maven to tell you where to look though
s
no worries, I'll get it.
thanks for the help
l
I'm curious to learn about your dependency setup
s
what do you mean?
l
How you got to have these two dependencies in your project, I'd like to know what is the setup, and I'm also curious how it happened.
s
which two dependencies? We have a java/kotlin multimodule project (maven) with a parent bom. In a submodule I specified the jdk8 coroutines library. that was it.
l
You're using maven and not Gradle?
s
for this project yes.
we’re having trouble converting it to gradle