You may encounter the below error while trying to start zookeeper in Confluent Kafka version on windows platform.
This could look something like this :
Start Zookeeper :
D:\confluent-community-5.5.0–2.12\confluent-5.5.0\bin\windows>zookeeper-server-start.bat D:\confluent-community-5.5.0–2.12\confluent-5.5.0\etc\kafka\zookeeper.properties
Error :
Classpath is empty. Please build the project first e.g. by running ‘gradlew jarAll’
How to fix this error ?:
Step 1 : Navigate to \confluent-community-5.5.0–2.12\confluent-5.5.0\bin\windows folder.
Step 2: Open kafka-run-class.bat file.
Step 3 : Search rem Classpath addition for core in this bat file.The code would look like this :
Step 4: Now, just add the below code just above the rem Classpath addition for core line.
rem classpath addition for LSB style path
if exist %BASE_DIR%\share\java\kafka\* (
call:concat %BASE_DIR%\share\java\kafka\*
)
Your code should look like this :
Step 5: Now, again try to run zookeeper with properties file and it should work fine this time.
Note : If you are looking to upskill yourself for Tech interviews on Kafka and Spring Kafka then look no further and grab your copy of “75 Interview Questions on Kafka and Spring Kafka” : Available here !
Please do checkout our Youtube channel to get yourself updated with latest Tech News : Available here !
