以下代码
package com.inthemoon.snippets.rxjava;
import io.reactivex.*;
public class HelloWorld {
public static void main(String[] args) {
Flowable.just("Hello world").subscribe(System.out::println);
}
}
导致以下编译错误
错误:(9, 15) java: cannot access org.reactivestreams.Publisher class file for org.reactivestreams.Publisher not found
POM 依赖项如下
<dependencies>
<!-- https://mvnrepository.com/artifact/io.reactivex.rxjava2/rxjava -->
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>2.0.4</version>
</dependency>
</dependencies>