I am new to Kotlin and trying to learn asynchronous programming using coroutine. I am following Kotlin official docs. But when I tried to compile my code, it showed me error: "unresolved reference: kotlinx". So I just want to know, how can I use Coroutine in non android projects?
I am using Ubuntu terminal to compile the code.
Code Snippet
import kotlinx.coroutines.*
fun main(args: Array<String>){
GlobalScope.launch{
delay(1000L)
println("World!")
}
println("Hello,")
Thread.sleep(2000L)
}