-
Notifications
You must be signed in to change notification settings - Fork 1k
Windows: sbt.bat fails when project path contains parentheses #8644
Copy link
Copy link
Closed
Labels
Bugarea/runner-scriptissues around sbt-the-bash-script, or bat scriptissues around sbt-the-bash-script, or bat scriptarea/windowsWindows-specific issueWindows-specific issue
Description
Description
SBT fails to run on Windows when the project directory path contains parentheses (). The Windows batch launcher (sbt.bat) does not properly escape or quote paths with special characters, causing CMD to interpret parentheses as command grouping syntax.
Steps to Reproduce
- Create a Windows user account with parentheses in the username (e.g.,
Anshuman(work)) - Create or clone an SBT project in a path containing parentheses:
C:\Users\Anshuman(work)\Desktop\myproject - Open CMD or PowerShell
- Navigate to the project directory
- Run any SBT command:
sbt compile
Expected Behavior
SBT should execute the command successfully, handling the parentheses in the path correctly.
Actual Behavior
In CMD:
) was unexpected at this time.
In PowerShell (calling sbt.bat):
) was unexpected at this time.
The error occurs because Windows CMD interprets ( and ) as special syntax for command grouping, and the SBT launcher script doesn't properly quote the working directory path.
Environment
- OS: Windows 11
- SBT Version: 1.11.7 (likely affects all versions)
- Java Version: OpenJDK 11.0.29
- Shell: Both CMD and PowerShell (when using sbt.bat)
- Path with issue: Any path containing
(or)characters
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bugarea/runner-scriptissues around sbt-the-bash-script, or bat scriptissues around sbt-the-bash-script, or bat scriptarea/windowsWindows-specific issueWindows-specific issue