JDK1.8

For details, see Installing JDK1.8 and configuring environment variables

Maven

Refer to Maven for download and installation

Flink

Refer to Flink for download and installation

The blog explains the download address of Flink and view the successful operation, according to the tutorial on the blog to download and install, in this blog will be detailed description of Flink project construction

Flink project construction

Use the Maven command to quickly build the Flink project

  • Use the following command to build Maven project. You need to input groundId and other project information in the command window, and search for the specific information if you do not know the meaning
mvn archetype:generate -DarchetypeGroupId=org.apache.flink -DarchetypeArtifactId=flink-quickstart-java - DarchetypeVersion = 1.10.0Copy the code
  • After building the Flink project, you can open it using the IDEA editor and in the editorterminalWindow input
mvn clean package
Copy the code

All the packages needed to develop Flink used in the POM.xml file are loaded at this point

  • One thing to note when building the demo code in the project, which can be downloaded from my GitHub, is that the default main function name is StreamingJob when no main function entry is specified to run

  • As for the code run, run it again

mvn clean package
Copy the code

Package the code to generate the JAR package, which is available in the target file

  • How to run the JAR package is explained in the download and installation section of the reference blog Flink