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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.0
    • 2.4.0
    • tools
    • 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

        1. kafka_image.png
          36 kB
          frost321

        Issue Links

          Activity

            People

              Unassigned Unassigned
              frost321 frost321
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: