1
votes

Searched everywhere, could not find a solution to my problem.

When I go to the directory after unpacking the binary version of Kafka (unpack it via terminal using the command tar -xzf), I try to start Zookeeper with the command (macOS Sierra):

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

I get the same error:

Error: Could not find or load main class config.zookeeper.properties

Download the latest binary version of Kafka (also tried earlier versions) - kafka_2.11-0.11.0.0.tgz - the result is the same - the same error.

In posts here write that the error in the downloaded version - source instead of binary. I only have binary.

Java version with the latest update (build 1.8.0_141-b15).

What could be the problem?

3
where are you getting this version? The latest I see at the Apache download site is kafka_2.11-0.11.0.0.tgz ( at www-us.apache.org/dist/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz) and if I tar -xvf kafka_2.11-0.11.0.0.tgz, then cd kafka_2.11-0.11.0.0, and then run bin/zookeeper-server-start.sh config/zookeeper.properties it starts fine on macOS SierraHans Jespersen
I've been sealed, you're right, the latest version is kafka_2.11-0.11.0.0 But the error has remained: (Denis
The error is a CLASSPATH error so something in your environment is changing the Java classpath or you are not using Java 1.8. What does java -version report?Hans Jespersen
java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)Denis
What's your PATH and CLASSPATH env variables and what directory are you in when you run bin/zookeeper-server-start.sh ?Hans Jespersen

3 Answers

0
votes

I encountered the same issue on my mac. It turned out the space of the path causing the problem. By removing it, it works. /Users/xxx/My Projects/kafka_2.11-0.11.0.0 => /Users/xxx/MyProjects/kafka_2.11-0.11.0.0

0
votes

Please run following commands:

wget http://www-eu.apache.org/dist/kafka/0.11.0.1/kafka_2.11-0.11.0.1.tgz
tar -xzf kafka_2.11-0.11.0.1.tgz
cd kafka_2.11-0.11.0.1
bin/zookeeper-server-start.sh config/zookeeper.properties
0
votes

Try to use complete path like this: bin/zookeeper-server-start.sh /usr/local/Cellar/kafka/1.1.0/libexec/config/zookeeper.properties