当我在我的 pom 文件中使用以下依赖项时:
<properties>
<rxkotlinfx.version>2.2.0</rxkotlinfx.version>
<rxkotlin.version>2.1.0</rxkotlin.version>
<kotlin.version>1.1.51</kotlin.version>
<tornadofx.version>1.7.12</tornadofx.version>
</properties>
<dependencies>
<dependency>
<groupId>com.github.thomasnield</groupId>
<artifactId>rxkotlinfx</artifactId>
<version>${rxkotlinfx.version}</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxkotlin</artifactId>
<version>${rxkotlin.version}</version>
</dependency>
<dependency>
<groupId>no.tornado</groupId>
<artifactId>tornadofx</artifactId>
<version>${tornadofx.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
并运行以下代码:
fun main(args: Array<String>) {
val source = listOf("A", "B", "C").toObservable()
.filter { it == "B" }
.subscribeBy(
onNext = { println(it) }
)
}
我收到以下错误:
Error:(37, 40) Kotlin: Cannot access class 'io.reactivex.Observable'. Check your module classpath for missing or conflicting dependencies
为什么我会收到此错误,我需要什么依赖项设置才能使用此堆栈?