I recently faced the same issue. This happens when the host machine has already IBM MQ server installed, which adds few entries to the classpath and it takes precedence while starting kafka server.
You can confirm this by opening a command prompt and run echo %CLASSPATH%
. If it returns something similar to the following, the issue is due to the presence of existing MQ installation; however editing environment variables to make kafka run will impact MQ instance.
D:\Runtimes\IBM\WebSphere MQ\java\lib\com.ibm.mqjms.jar;D:\Runtimes\IBM\WebSphere MQ\java\lib\com.ibm.mq.jar
To overcome the problem:
- Locate
bin/windows/kafka-run-class.bat
.
- Edit the file and add the following line in the beginning of the script
set CLASSPATH=""
Basically we are resetting the CLASSPATH before the Kakfa startup script attempts to generate the classpath from the Kakfa libraries.
I hope this will solve the issue.