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

          Code changed in jenkins
          User: Spyros Kapnissis
          Path:
          src/main/java/org/jvnet/hudson/plugins/SbtPluginBuilder.java
          http://jenkins-ci.org/commit/sbt-plugin/e9875fec697b72bd61867967f8447bce70d72fdb
          Log:
          JENKINS-24346: add an extra set of quotes after cmd/c to handle paths with spaces in Windows.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Spyros Kapnissis Path: src/main/java/org/jvnet/hudson/plugins/SbtPluginBuilder.java http://jenkins-ci.org/commit/sbt-plugin/e9875fec697b72bd61867967f8447bce70d72fdb Log: JENKINS-24346 : add an extra set of quotes after cmd/c to handle paths with spaces in Windows.

          Code changed in jenkins
          User: wolfg
          Path:
          src/main/java/org/jvnet/hudson/plugins/SbtPluginBuilder.java
          http://jenkins-ci.org/commit/sbt-plugin/ad29607b14655f0c2ab55c1e48096ba8251c09ae
          Log:
          Merge pull request #14 from spyk/master

          JENKINS-24346: add an extra set of quotes after cmd/c to handle paths wi...

          Compare: https://github.com/jenkinsci/sbt-plugin/compare/f909e167c39c...ad29607b1465

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: wolfg Path: src/main/java/org/jvnet/hudson/plugins/SbtPluginBuilder.java http://jenkins-ci.org/commit/sbt-plugin/ad29607b14655f0c2ab55c1e48096ba8251c09ae Log: Merge pull request #14 from spyk/master JENKINS-24346 : add an extra set of quotes after cmd/c to handle paths wi... Compare: https://github.com/jenkinsci/sbt-plugin/compare/f909e167c39c...ad29607b1465

          ankit bisaria added a comment -

          Console Output

          Started by user Ankit Bisaria
          Building in workspace E:\test
          [test] $ cmd.exe /C 'C:\Program Files (x86)\Jenkins\"C:\Program Files\Java\jdk1.7.0_60"\bin\java' -Dsbt.log.noformat=true -jar '"C:\Program Files (x86)\sbt\bin\sbt-launch.jar"' clean dist
          '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
          Build step 'Build using sbt' marked build as failure
          Finished: FAILURE
          

          I can not integrate sbt plugin with jenkins. Please fix this as I need this urgently in a project.

          Thanks.

          ankit bisaria added a comment - Console Output Started by user Ankit Bisaria Building in workspace E:\test [test] $ cmd.exe /C 'C:\Program Files (x86)\Jenkins\ "C:\Program Files\Java\jdk1.7.0_60" \bin\java' -Dsbt.log.noformat= true -jar ' "C:\Program Files (x86)\sbt\bin\sbt-launch.jar" ' clean dist '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 Build step 'Build using sbt' marked build as failure Finished: FAILURE I can not integrate sbt plugin with jenkins. Please fix this as I need this urgently in a project. Thanks.

          Hi, this fix has not been included in a release yet. In the meantime you can try building the master branch yourself with maven (https://github.com/jenkinsci/sbt-plugin), and manually install the plugin jar to jenkins.

          Spyros Kapnissis added a comment - Hi, this fix has not been included in a release yet. In the meantime you can try building the master branch yourself with maven ( https://github.com/jenkinsci/sbt-plugin ), and manually install the plugin jar to jenkins.

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

              Created:
              Updated: