Steps to reproduce problem:
1. Clone Kafka repo using git clone.
2. Run some Bash-script, which invokes kafka-run-class.sh (without building project beforehand).
$ ./bin/zookeeper-server-start.sh config/zookeeper.properties
Error: Could not find or load main class config.zookeeper.properties
Error is misleading. This happens, because kafka-run-class.sh tries to run this command:
java ...a lot of JVM options... -cp org.apache.zookeeper.server.quorum.QuorumPeerMain config/zookeeper.properties
Script doesn't check for empty $CLASSPATH variable. It's empty, because we didn't build project.
kafka-run-class.bat script for Windows checks for it:
IF ["%CLASSPATH%"] EQU [""] (
echo Classpath is empty. Please build the project first e.g. by running 'gradlew jarAll'
EXIT /B 2
I think, we should add similar check to Bash-script, and show similar error.