1.通过命令快速生成一个flink项目
curl https://flink.apache.org/q/quickstart.sh | bash -s 1.19.1
生成文件目录:
其中pom文件包好我们所需要的基础flink相关依赖
2.测试
java
public class DataStreamJob {
public static void main(String[] args) throws Exception {
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
DataStreamSource<String> stringDataStreamSource = env.fromData(Arrays.asList("1", "2", "3"));
stringDataStreamSource.print();
env.execute("Flink Java API Skeleton");
}
}
3.测试结果
成功!