问题描述
跑flink源码无任何问题,但是自己创建一个新的flink项目就会出现错误
Error: A JNI error has occurred, please check your installation and try again
问题出现的环境背景及自己尝试过哪些方法
flink:1.8.0
jdk:1.8.0_221-b11
maven:3.6.2
1.搜索网上方法无法解决
版本一样
2.https://kb.froglogic.com/squish/java/howto/use-java-web-start-squish/
相关代码
public class SocketWindowWordCount {
public static void main(String\[\] args) throws Exception {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
DataStream<String> text = env.socketTextStream("localhost", 9000, "\\n");
DataStream<Tuple2<String, Integer>> windowCounts = text
.flatMap(new FlatMapFunction<String, Tuple2<String, Integer>>() {
@Override
public void flatMap(String value, Collector<Tuple2<String, Integer>> out) {
for (String word : value.split("\\\\s")) {
out.collect(Tuple2.of(word, 1));
}
}
})
.keyBy(0)
.timeWindow(Time.seconds(5))
.sum(1);
windowCounts.print().setParallelism(1);
env.execute("Socket Window WordCount");
}
}