Monday, January 04, 2021

How to solve Classpath is empty. Please build the project first e.g. by running ‘gradlew jarAll’ for Kafka

 Many times when you try to run your Kafka or confluent kafka on windows you get following errors shown below

C:\Latest_JAVA_eclipse_WorkSpace\siddhukafkaexample\script>siddhu-confluent-kafka-java-topics.bat

C:\Latest_JAVA_eclipse_WorkSpace\siddhukafkaexample\script>kafka-topics.bat –create –zookeeper localhost:2181 –replication-factor 3 –partitions 3 –topic SiddhuAvroTopic –config min.insync.replicas=2
Classpath is empty. Please build the project first e.g. by running ‘gradlew jarAll’

To over come this add below given lines in your kafka-run-class.bat present inside C:\confluent-community-6.0.1\confluent-6.0.1\bin\windows folder

1
2
3
4
rem classpath addition for LSB style path by siddhu
if exist %BASE_DIR%\share\java\kafka\* (
call:concat %BASE_DIR%\share\java\kafka\*
)

Then try to rerun the command and it will be executed properly.

No comments: