In this post, we will download and setup Kafka in PATH for Windows operating system. Apache Kafka is an open-source distributed event streaming platform used by thousands of companies for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.
Download Apache Kafka
Once you have downloaded and installed the Java Development Kit 8, you can now proceed to setup the Kafka. Go to Kafka downloads page and download the Binary file.
At the time of writing this blog, the latest version is 2.8.0. I will go ahead and download the Scala 2.13 binary file. It will take me to the downloads page. I will click on the first link to download.
I have copied the folder and put it in the C drive at the root location.
Check the JDK Version
Open the command line tool (Command Prompt) and run the following command to check the java version.
If the version is 1.8, then you are good to proceed.
Verify Kafka Command
Open the command line from the Kafka root folder.
Run the following command to run kafka-topic.bat file.
If this command works fine then you verify that Kafka is downloaded properly and Java is installed. You will get a similar output by running this command.
Set up the PATH
Currently, you are running this .bat file by navigating to bin/windows/. I want to run it from any location. For that, we need to set up the PATH for bin/windows so that I can run all the .bat commands without navigating to this location.
Copy the Full path of the windows folder. It should be something similar as below. If you have saved the Kafka folder in another location then the path before Kafka folder will be different for you.
Go to Start and search for Environment Variables. Click on
Edit environment variables for your account.
Select Path and click on Edit.
Click on New and paste the Full path and click on OK.
Again click on OK. This will set up the path in the environment variables. Now, you can run the .bat files present inside the bin/windows folder without navigating to it.
To test this, open command prompt from any directory and run the below .bat file.
In our next post, we will start the Zookeeper and the Kafka.