Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-24346

Cannot launch sbt when either java or sbt-launcher path contains spaces in Windows

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • sbt-plugin
    • Windows Server 2008 R2 Standard, JDK 1.7.0.51

      I get the following error when trying to run the sbt plugin through a windows path that contains spaces.

      [workspace] $ cmd.exe /C "C:\Program Files\Java\jdk1.7.0_51\bin\java" -Xms1024M -Xmx1024M -XX:+CMSClassUnloadingEnabled -Dsbt.log.noformat=true -jar "C:\Program Files (x86)\sbt\bin\sbt-launch.jar" runMain

      'C:\Program' is not recognized as an internal or external command, operable program or batch file.
      Build step 'Build using sbt' changed build result to FAILURE

      I think the correct syntax is to place the whole command in extra quotes in immediately after cmd /c and at the end.

      So this works for me when I run it through the command line:

      cmd.exe /C " "C:\Program Files\Java\jdk1.7.0_51\bin\java" -Xms1024M -Xmx1024M -XX:+CMSClassUnloadingEnabled -Dsbt.log.noformat=true -jar "C:\Program Files (x86)\sbt\bin\sbt-launch.jar" runMain "

          [JENKINS-24346] Cannot launch sbt when either java or sbt-launcher path contains spaces in Windows

          Spyros Kapnissis created issue -
          Spyros Kapnissis made changes -
          Description Original: I get the following error when trying to run the sbt plugin through a windows path that contains spaces.

          {quote}
          [workspace] $ cmd.exe /C "C:\Program Files\Java\jdk1.7.0_51\bin\java" -Xms1024M -Xmx1024M -XX:+CMSClassUnloadingEnabled -Dsbt.log.noformat=true -jar "C:\Program Files (x86)\sbt\bin\sbt-launch.jar" runMain

          'C:\Program' is not recognized as an internal or external command, operable program or batch file.
          Build step 'Build using sbt' changed build result to FAILURE
          {quote}

          I think the correct syntax is to place the whole command in extra quotes in immediately after cmd /c and at the end.
          New: I get the following error when trying to run the sbt plugin through a windows path that contains spaces.

          {quote}
          [workspace] $ cmd.exe /C "C:\Program Files\Java\jdk1.7.0_51\bin\java" -Xms1024M -Xmx1024M -XX:+CMSClassUnloadingEnabled -Dsbt.log.noformat=true -jar "C:\Program Files (x86)\sbt\bin\sbt-launch.jar" runMain

          'C:\Program' is not recognized as an internal or external command, operable program or batch file.
          Build step 'Build using sbt' changed build result to FAILURE
          {quote}

          I think the correct syntax is to place the whole command in extra quotes in immediately after cmd /c and at the end.

          So this works for me when I run it through the command line:

          cmd.exe /C " "C:\Program Files\Java\jdk1.7.0_51\bin\java" -Xms1024M -Xmx1024M -XX:+CMSClassUnloadingEnabled -Dsbt.log.noformat=true -jar "C:\Program Files (x86)\sbt\bin\sbt-launch.jar" runMain "
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 157266 ] New: JNJira + In-Review [ 179548 ]

            uzilan uzilan
            spyk Spyros Kapnissis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: