Wednesday, September 4, 2019

Solve: QTJava.zip was unexpected at this time error occurred while starting ZooKeeper

Recently I have got an error i.e. \QuickTime\QTSystem\QTJava.zip was unexpected at this time. while starting ZooKeeper that comes packaged with Kafka on Windows system. One might face a similar issue while quickly setting up the Kafka Cluster on Windows systems. That's why sharing the solution.

Error:

D:\kafka\kafka_2.12-2.3.0>bin\windows\zookeeper-server-start.bat config\zookeeper.properties
\QuickTime\QTSystem\QTJava.zip was unexpected at this time.

D:\kafka\kafka_2.12-2.3.0>

Solution:

The error was happening due to the spaces in the folder name present in the %CLASSPATH% environment variable. One just needs to remove the spaces and it would work. 

When I used echo %CLASSPATH% command in CMD it showed me below value:
.;C:\Program Files (x86)\QuickTime\QTSystem\QTJava.zip

I just removed the above entry from CLASSPATH environment variable and tried starting the Zookeeper, it worked like charm. 

Somehow the batch script i.e. zookeeper-server-start.bat is unable to handle the spaces in the environment variables. For me, it has happened due to the CLASSPATH environment variable, but someone might get an error if they have space containing entries in their PATH or JAVA_HOME environment variable. 

Happy Learning!! Let me know if you face this issue and if this solution worked for you also in the comments section. 


No comments:

Post a Comment