If you want to run Flink locally on a Windows machine you need to download and unpack the binary Flink distribution. After that you can either use the Windows Batch file (
.bat), or use Cygwin to run the Flink Jobmanager.
To start Flink in local mode from the Windows Batch, open the command window, navigate to the
bin/ directory of Flink and run
bin folder of your Java Runtime Environment must be included in Window’s
%PATH% variable. Follow this guide to add Java to the
$ cd flink $ cd bin $ start-local.bat Starting Flink job manager. Web interface by default on http://localhost:8081/. Do not close this batch window. Stop job manager by pressing Ctrl+C.
After that, you need to open a second terminal to run jobs using
With Cygwin you need to start the Cygwin Terminal, navigate to your Flink directory and run the
$ cd flink $ bin/start-local.sh Starting jobmanager.
If you are installing Flink from the git repository and you are using the Windows git shell, Cygwin can produce a failure similar to this one:
c:/flink/bin/start-local.sh: line 30: $'\r': command not found
This error occurs because git is automatically transforming UNIX line endings to Windows style line endings when running in Windows. The problem is that Cygwin can only deal with UNIX style line endings. The solution is to adjust the Cygwin settings to deal with the correct line endings by following these three steps:
Start a Cygwin shell.
Determine your home directory by entering
This will return a path under the Cygwin root path.
Using NotePad, WordPad or a different text editor open the file
.bash_profile in the home directory and append the following: (If the file does not exist you will have to create it)
export SHELLOPTS set -o igncr
Save the file and open a new bash shell.