Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Classpath is empty. Please build the project first e.g. by running './gradlew jar -PscalaVersion=2.11.12'

I am not able to run a Apache Kafka service due to a failure while trying to start a Zookeeper instance. I have downloaded and tried it with all 3 availabe downloads at the official site. (binarys and source) When i try to start zookeeper with

./bin/zookeeper-server-start.sh config/zookeeper.properties

I always get the same error message:

Classpath is empty. Please build the project first e.g. by running './gradlew jar -PscalaVersion=2.11.12'

The same goes for (after starting a seperate zookeeper (not the build-in from kakfa) instance)

./bin/kafka-server-start.sh config/server.properties

I have tried it under Ubuntu 17.04 and 18.04. When i try this on a virtual machine using Ubuntu 16.04 it works.

Unfortunatly, all i found regarding this problem, was for Windows. Thank you for any help.

like image 852
Andreas bleYel Avatar asked May 06 '18 08:05

Andreas bleYel


4 Answers

In my case it has nothing to do with the binary or source cause both of them give that same "classpath is empty please build the project first" error. Its because there is a space in the path where kafka resides.

like image 59
Mideel Avatar answered Oct 07 '22 14:10

Mideel


I had the same issue, the problem was I was downloading the source of Kafka. So to make my Kafka server run, I downloaded the Kafka binaries and it worked for me.

Kafka binaries: http://mirror.cc.columbia.edu/pub/software/apache/kafka/1.1.0/

like image 34
shahidammer Avatar answered Oct 07 '22 15:10

shahidammer


We need to download kafka-binary and not the source Download Binary from mirror http://mirrors.estointernet.in/apache/kafka/2.2.0/kafka_2.11-2.2.0.tgz

like image 15
Amar Avatar answered Oct 07 '22 14:10

Amar


Go to your terminal and run:

$ ./gradlew jar -PscalaVersion=2.11.12
like image 4
Ferds Avatar answered Oct 07 '22 14:10

Ferds