How can I enable remote debugging for SBT in windows?

user1875195 picture user1875195 · Apr 28, 2014 · Viewed 9.8k times · Source

I would like to accomplish running the equivalent of this

sbt -jvm-debug 5005

However I don't seem to be able to pass in args in Windows. This is what I am seeing

>sbt -jvm-debug 5005
[info] Loading project definition from [myProject]
[info] Set current project to [myProject] (in build file myProject)
[error] Expected letter
[error] Expected symbol
[error] Expected '!'
[error] Expected '+'
[error] Expected '++'
[error] Expected ';'
[error] Expected end of input.
[error] Expected 'show'
[error] Expected '*'
[error] Expected '{'
[error] Expected project ID
[error] Expected configuration
[error] Expected key
[error] 5005
[error] ^
[error] Not a valid command: jvm-debug
[error] Not a valid project ID: jvm-debug
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: jvm-debug
[error] jvm-debug
[error]          ^                  

I would like to be able to remote debug this application from Intellij. Any help would be great!

Answer

Grzegorz Kazior picture Grzegorz Kazior · Jun 11, 2015
set SBT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
sbt run

was the only working solution on Windows 7.