There’s a typical error for Apache Flink rookies:
Exception in thread "main" java.lang.RuntimeException: No new data sinks have been defined since the last execution. The last execution refers to the latest call to 'execute()', 'count()', 'collect()', or 'print()'. at org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:910) at org.apache.flink.api.java.ExecutionEnvironment.createProgramPlan(ExecutionEnvironment.java:893) at org.apache.flink.api.java.LocalEnvironment.execute(LocalEnvironment.java:50) at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:789) ...
It is caused by the one line in the Apache Flink quickstart tutorial (Word Count example):
The documentation lists the code with the env.execute() statement after calling print() method on a resulting dataset when there are no sinks to proceed.
The print() method triggers the execution by itself so you don’t need to call it manually. In this case just remove the env.execute() line.
If this was not your case, try to explicitly create data sinks.
Here’s the working example of Apache Flink Java Word Count.