Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9710

Windows kafka-server-start.bat script fails when Kafka is located in path with whitespace

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.0
    • Component/s: tools
    • Labels:
      None

      Description

      Steps to reproduce:

      On Windows when you place Kafka to directory path with space, for example "C:\kafka path with whitespace" in it and run ".\bin\windows\kafka-server-start.bat", script will fail with error message "Error: Could not find or load main class path" (example in image). 

      Possible solution:

      Working solution is to remove double quotes around %CLASSPATH% variable in "kafka-run-class.bat" since all paths included in %CLASSPATH% variable already includes double quotes around them. So changing line 179 in file "kafka-run-class.bat" 
      FROM:

      set COMMAND=%JAVA% %KAFKA_HEAP_OPTS% %KAFKA_JVM_PERFORMANCE_OPTS% %KAFKA_JMX_OPTS% %KAFKA_LOG4J_OPTS% -cp "%CLASSPATH%" %KAFKA_OPTS% %*
      

      TO:

      set COMMAND=%JAVA% %KAFKA_HEAP_OPTS% %KAFKA_JVM_PERFORMANCE_OPTS% %KAFKA_JMX_OPTS% %KAFKA_LOG4J_OPTS% -cp %CLASSPATH% %KAFKA_OPTS% %*
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              frost321 frost321

              Dates

              • Created:
                Updated:

                Issue deployment