I‘m using intellij for a while now. There I work on a javaFx project, which is mainly written in java but I discovered Kotlin to be a nice alternative.

Recently I read about coroutines in Kotlin and I just can‘t figure out how to add the Kotlinx library to my project. I can only find the snippets for maven and gradle. But I‘m a complete nobby at this and I don‘t use one of this (At least I think so). So how can I add the kotlinx stuff to my project???

Kotlinx: KotlinX coroutines

Project structure: enter image description here

推荐答案

In the Project Structure dialog, go to Project Settings | Libraries, press "+" button and select "From Maven..." in the popup. In the dialog that appears, enter the name and version of the library you need, which you can find out in the documentation. (For the current version of the core library of kotlinx.coroutines, enter org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2). Then select the modules to which the library will be added.

Kotlin相关问答推荐

Kotlin-删除按钮周围的空格

Android Jetpack编写androidx.compose.oundation.lazy.grid.Items

Scala与Kotlin中的迭代

Criteria Api 中的 Kotlin 泛型

为什么会出现Kotlin.Unit错误以及如何修复它?

将一个列表元素分组为多个组(indexBy)

为什么这个 Kotlin 代码不起作用? (如果 str[index] 在列表中,则打印)

kotlin 单例异常是好是坏?

将子元素放在一个列表中

如何在 kotlin 中通过反射设置委托属性值?

TestContainers PostgreSQLContainer 与 Kotlin 单元测试:Not enough information to infer type variable SELF

下拉通知面板时是否可以暂停Android中的任何视频(媒体播放器)应用程序?

如何在 kotlin 中生成 json 对象?

kotlin:扩展方法和空接收器

ActivityOptions.makeSceneTransitionAnimation 在具有多个视图的 kotlin 中不起作用

用Gradle Kotlin DSL构建源jar?

TypeConverter()在Android的TypeConverter错误中具有私有访问权限

具有泛型param的Kotlin抽象类和使用类型param的方法

如何在kotlin用mockito模仿lambda

为什么 Kotlin 会收到这样的 UndeclaredThrowableException 而不是 ParseException?