[Kafka Cookbook] Building from Source

Kafka Binaries are available for download from http://kafka.apache.org/downloads.html. Many prefer to build from a source version. Let’s see how to build from the source.

Building the source download

Kafka Source can be downloaded from Downloads page http://kafka.apache.org/downloads.html Once downloaded, extract the artifact. Move to the extracted folder and execute following command

$gradle
$./gradlew releaseTarGz

The artifact can be found in core/build/distributions directory

Building from git clone

The process is same, as for the source download

If you get the following error

bash-3.2$ ./gradlew jar
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

To fix this execute following commands

$gradle wrap
// Some output
$ gradle clean

After executing the above commands, run the build command again. The build shall produce the artifact.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.