5
votes

I am trying to install Apache Kafka on my computer. I downloaded newest version 2.12-2.0.0. I want to run it on Windows, after typing ".\zookeeper-server-start.bat ../../config/zookeeper.properties" inside \bin\windows directory I am receiving:

Error: Could not find or load main class Files\Java\jdk-10.0.1\lib;C:\Program Caused by: java.lang.ClassNotFoundException: Files\Java\jdk-10/0/1\lib;C:\Program

Java works on my computer properly java -version:

openjdk version "10.0.1" 2018-04-17 OpenJDK Runtime Environment (build 10.0.1+10) OpenJDK 64-Bit Server VM (build 10.0.1+10, mixed mode)

JDK is located inside C:\Program Files\Java\jdk-10.0.1 I have variables:

JAVA_HOME=C:\Program Files\Java\jdk-10.0.1
JDK_HOME=%JAVA_HOME%
JRE_HOME=%JAVA_HOME%\jre
PATH: C:\Program Files\Java\jdk-10.0.1\bin 
CLASSPATH: %JAVA_HOME%\lib;%JAVA_HOME%\jre\
2
I had similar issues under windows and solved by using git bash and the .sh version of the executables of kafka and zookeeper - Paizo

2 Answers

2
votes

Your JAVA_HOME cannot contain spaces (i believe there's an open JIRA for fixing this)

Try C:\PROGRA~1\Java\jdk-10.0.1, and if that doesn't work, install Java 8 to somewhere like C:\jdk1.8.0\, as lower versions of Kafka don't support Java 10

0
votes

Set the below configurations in your kafka-run-class.bat and try to start the server

SET "JAVA_HOME=C:\Program Files\Java\jdk-10.0.1"

set "CLASSPATH=C:\Program Files\Java\jdk-10.0.1\lib;C:\Program Files\Java\jdk-10.0.1\lib\tools.jar;C:\Program Files\Java\jdk-10.0.1\lib\slf4j-api-1.7.25.jar"