无法运行Kafka-在cmd中没有输出,并且在Git Bash中没有这样的文件或目录错误

anu*_*rag 0 apache-kafka

我正在本地设置Kafka。我已经解压缩了2.12版本并启动了zookeeper。Zookeeper已启动并正在运行,但是当我尝试使用命令启动kafka时.\bin\windows\kafka-server-start.bat .\config\server.properties,它没有显示任何输出。

我也使用命令在git bash中尝试过bin/kafka-server-start.sh config/server.properties,它给出了错误

/c/kafka/kafka_2.12-2.1.0/bin/kafka-run-class.sh:第306行:C:\ Program:没有此类文件或目录。

您能为我提供解决方案吗?

Sag*_*gan 7

I use git bash on windows, and run the scripts in kafka_2.12-2.2.0\bin (not kafka_2.12-2.2.0\bin\windows).

Add double quotes around the JAVA term, in line 306.

exec "$JAVA" $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS "$@"
Run Code Online (Sandbox Code Playgroud)

If that does not help, add "set -x" at the top of the "kafka-run-class.sh" script to see the real problem.

#!/bin/bash
set -x
Run Code Online (Sandbox Code Playgroud)