Classpath is empty. Please build the project first e.g. by running 'gradlew jarAll'

27,659 views
Skip to first unread message

rajat...@m.darcl.com

unread,
Feb 27, 2017, 3:01:32 AM2/27/17
to Confluent Platform
Hello 
I am trying to use Apache Kafka on Windows(10). 

Used the Command as:
C:\kafka-0.10.2.0-src\bin\windows>zookeeper-server-start.bat cd.. cd.. cd config/windows zookeeper.properties 

Got Error as: 
Classpath is empty. Please build the project first e.g. by running 'gradlew jarAll'

I dont think there is a need to modify the command because system doesn't through an Error of Command.. Its an Error coming from file kafka-run-class.bat 

Please help me out ASAP

Eno Thereska

unread,
Feb 27, 2017, 9:18:25 AM2/27/17
to Confluent Platform
I haven't tried on windows, but did you try the suggestion to use gradlew jarAll? Is the classpath empty, i.e., did you build the project?

Thanks
Eno

rajat...@m.darcl.com

unread,
Feb 27, 2017, 11:02:16 PM2/27/17
to Confluent Platform
Thanks for replying

I have tried "gradlew jarAll" command but it didn't work. 

Got this Error:
'gradlew' is not recognized as an internal or external command, operable program or batch file. 

I don't know how to build the Project. Is that necessary ? if so please give me some guidance on how to build the project. 
All i do is downloaded the zookeeper and Kafka from official website. Installed jre-8u121-windows-x64.
Also please tell me if i should have the full working knowledge of JAVA for using KAFKA, I am working on Angular with Nodejs. 
Please help me out

Eno Thereska

unread,
Feb 28, 2017, 3:01:55 AM2/28/17
to Confluent Platform
Did you download the source or the JARs? If you downloaded the JARs you don't need to build anything, but it wasn't clear from the original message.

Thanks
Eno

rajat...@m.darcl.com

unread,
Feb 28, 2017, 5:48:56 AM2/28/17
to Confluent Platform
I downloaded from http://kafka.apache.org/downloads.html
I downloaded Source from the above link.

Thanks
Rajat

rajat...@m.darcl.com

unread,
Feb 28, 2017, 6:43:07 AM2/28/17
to Confluent Platform
I downloaded Binary from that link too 

Binary downloads:
Now i used these Commands:

1.) C:\kafka\bin\windows>zookeeper-server-start.bat

USAGE: zookeeper-server-start.bat zookeeper.properties


2.) C:\kafka>c:\kafka\bin\windows\zookeeper-server-start.bat c:\kafka\config\zookeeper.properties

The syntax of the command is incorrect.
The system cannot find the path specified.


3.) C:\kafka\bin\windows>zookeeper-server-start.bat cd.. cd.. cd config zookeeper.properties

The syntax of the command is incorrect.
The system cannot find the path specified.

4.) C:\kafka>.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

Tried in Powershell too:
PS C:\kafka> .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
The system cannot find the path specified.

Tried everything but none worked.

My zookeeper-server-start.bat is in C:\kafka\bin\windows\zookeeper-server-start.bat 

My zookeeper.properties is in C:\kafka\config\zookeeper.properties

Eno Thereska

unread,
Mar 1, 2017, 9:15:29 AM3/1/17
to Confluent Platform
I haven't tried to run on windows lately, but a search revealed a couple of links, e.g., :

Eno

rajat...@m.darcl.com

unread,
Mar 2, 2017, 2:40:22 AM3/2/17
to Confluent Platform
Dear Sir,
I have tried the command in Windows 7 Powershell, it worked fine and kafka started:
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties 

but for Windows 10 this command throws an error:
The syntax of the command is incorrect.
The system cannot find the path specified.

Thanks

Please help me with this issue..

rajat...@m.darcl.com

unread,
Mar 3, 2017, 2:37:18 AM3/3/17
to Confluent Platform
Dear Eno,
My Kafka started successfully.. the error was maybe with the java latest version. I uninstalled it and used the old one that was in my system. restarted the system and it worked fine. the only problem i am facing now is of setting up multi broker on same local machine. 
Its throwing an error as:
kafka.common.KafkaException: Socket server failed to bind to 0.0.0.0:9092: Address already in use: bind.

Eno Thereska

unread,
Mar 3, 2017, 7:07:01 AM3/3/17
to Confluent Platform
You need to create another server.properties file for the second broker and assign it a different port, since the first broker is using 9092.

Eno

rajat...@m.darcl.com

unread,
Mar 3, 2017, 11:01:42 PM3/3/17
to Confluent Platform
Thanks,
Actually what i was doing wrong is that i haven't removed the # from listeners. Everything is working fine till now.
I want to integrate this with Nodejs but i was not able to find out what exactly Kafka do coz there are no simple ideas for real implementation scenario or i am too much rookie to understand 
for example:
In my company i have a query to fetch "Open Orders" i request for Open Orders from database. 
Suppose query is like "Select * from Orders where IsCompleted = 0"  
I want to know where exactly the Apache Kafka plays its role. 
Can it be implemented or not.

tushar banne

unread,
Mar 25, 2017, 4:39:14 PM3/25/17
to Confluent Platform
Hi Rajat,
I am using java 1.8.6. I am getting the same error "Classpath is empty. Please build the project first e.g. by running 'gradlew jarAll' " in windows 10.
Please let me know which version of java does the kafka server support.

tushar banne

unread,
Mar 25, 2017, 6:23:32 PM3/25/17
to Confluent Platform
Hi,
I have tried using java 1.7.04, but that did not work out for me. Please provide any other option if available.

rajat...@m.darcl.com

unread,
Mar 26, 2017, 8:36:44 AM3/26/17
to Confluent Platform
Hi Tushar, please let me know from where u downloaded Kafka and whatever you did till now

tushar banne

unread,
Mar 27, 2017, 3:06:10 AM3/27/17
to Confluent Platform
Hi Rajat,
I have downloaded Kafka from below link.


Then I downloaded Zookeeper from
 


Modified the zkserver.cmd to point to the installed java directory.

modified the config files for data and kafka log.

then ran the command 
.\bin\windows\kafka-server-start.bat .\config\server.properties


Thanks 
Tushar Banne.

rajat...@m.darcl.com

unread,
Mar 28, 2017, 6:02:18 AM3/28/17
to Confluent Platform
Hi Tushar,
Firstly if you have java installed.. you don't need to setup a different directory eg: JAVA HOME etc.. Just let Java install normally.. 
Then just start the zookeeper, don't try to modify anything firstly.. zookeeper's properties and batch file are included in Kafka bundle..
then start the Kafka server..
let me know if that worked.. because you don't need to install anything like graddle etc 

rajat...@m.darcl.com

unread,
Mar 28, 2017, 6:06:27 AM3/28/17
to Confluent Platform
Also try to use Powershell instead of CMD.. search for it it in windows search.. 
go to the Kafka directory and then type the zookeeper command as:
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

then start Kafka Server as:
.\bin\windows\kafka-server-start.bat .\config\server.properties

create Topic as:
.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

start producer as:
.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic test

let me know if this worked

tushar banne

unread,
Mar 28, 2017, 9:25:03 AM3/28/17
to Confluent Platform

Hi Rajat,
Powershell worked just fine.
I have started the kafka and zookeeper sever in two power shells. Is it fine?

Thanks a lot. Also I observed that if the path is too long, it gives error.

So moved the Kafka folder to D:\.

Thanks 
Tushar

rajat...@m.darcl.com

unread,
Mar 28, 2017, 1:36:23 PM3/28/17
to Confluent Platform
Yeah it is absolutely fine.. 
zookeeper 
Kafka Server or any number of Kafka servers (we call them as brokers) they all run in separate Consoles.
For starting multiple Kafka servers you have to make duplicate copies of same server.properties (say server-1.properties) file and config them (Broker ids).

manoj chowdary

unread,
Jun 3, 2017, 9:27:18 PM6/3/17
to Confluent Platform
Hi rajat,
I have tried the commands in powershell too but it keeps on giving me the same error as classpath not built,please build the project by running "gradlew jarAll"

Can you please help me out 

Thanks 

ragesh rajendran

unread,
Jun 9, 2017, 2:17:25 PM6/9/17
to Confluent Platform
Same here. I tried it in windows 10 but the same issue is happening to me also. Zookeeper started fine but while starting kafka this error is coming.

PS C:\kafka> .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
The syntax of the command is incorrect.
Classpath is empty. Please build the project first e.g. by running 'gradlew jarAll'
PS C:\kafka>
Reply all
Reply to author
Forward
0 new messages