I want to add kotlinx.coroutines
to the command line compiler of the Kotlin so that i can import it without using gradle. For example I have a file Main.kt
and no gradle tool for Kotlin. just look at mywindow. I tried search on YouTube, StackOverflow, reddit, Google and Github but it didn't solved my problem please help me out.
Asked
Active
Viewed 454 times
2

Rajuda
- 21
- 3
-
You need to download the jar file from the internet. Then read the POM file, find all its dependencies then download them as well. And look for their dependencies, download and so on. When you'll have all required jar files, pass a list of them using `-cp` argument to `kotlinc` command. – broot Apr 08 '22 at 19:29
-
Fortunately, it seems coroutines libs don't have any external dependencies. Still, depending what features of coroutines do you need (android, jdk8, etc.), you need to download multiple files. – broot Apr 08 '22 at 19:39
-
https://jar-download.com/artifacts/org.jetbrains.kotlinx/kotlinx-coroutines-core from here i downloaded the dependencies as well the library's jar files now what to do and how to do – Rajuda Apr 09 '22 at 05:56
1 Answers
1
You will need to use the Kotlin compiler directly:
https://kotlinlang.org/docs/command-line.html
In addition, to use kotlinx.coroutines
, you will need to have these JARs locally and add them to the classpath to the Kotlin compiler:
https://kotlinlang.org/docs/compiler-reference.html#classpath-path-cp-path

Cisco
- 20,972
- 5
- 38
- 60
-
https://jar-download.com/artifacts/org.jetbrains.kotlinx/kotlinx-coroutines-core I have downloaded the files with dependencies but yet unable to do so can please elaborate how can i do this. You made me reach a bit closer to the solution of this problem – Rajuda Apr 09 '22 at 05:54
-
https://stackoverflow.com/questions/54166069/how-do-you-add-local-jar-file-dependency-to-build-gradle-kt-file may be this question solve the problem as I got the jar files but I donot have gradle what should I do now – Rajuda Apr 09 '22 at 05:59
-
No this is not working. I first time met with such type of problem in kotlin. – Himanshu Singh Chauhan Apr 09 '22 at 10:36