我想完成运行相当于此的操作
sbt -jvm-debug 5005
但是我似乎无法在Windows中传递args.这就是我所看到的
>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] ^
我希望能够从Intellij远程调试此应用程序.任何帮助都会很棒!
set SBT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 sbt run
是Windows 7上唯一可行的解决方案.
似乎Windows版本的SBT没有定义此功能.
在Linux上,它在$SBT_HOME/sbt/bin/sbt-launch-lib.bash
as中定义
addDebugger () { addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1" }
通过SBT_OPTS
在Windows上设置环境变量,可以获得相同的结果.
像这样运行SBT,使调试器侦听端口5005
set SBT_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" && sbt