如何在 Windows 中启用 SBT 远程调试? [英] How can I enable remote debugging for SBT in windows?
问题描述
我想完成与此等价的运行
I would like to accomplish running the equivalent of this
sbt -jvm-debug 5005
但是我似乎无法在 Windows 中传递参数.这就是我所看到的
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] ^
我希望能够从 Intellij 远程调试此应用程序.任何帮助都会很棒!
I would like to be able to remote debug this application from Intellij. Any help would be great!
推荐答案
好像 Windows 版本的 SBT 没有定义这个功能.
Seems like the Windows version of SBT doesn't define this functionality.
在 Linux 上,它在 $SBT_HOME/sbt/bin/sbt-launch-lib.bash
中定义为
On Linux it is defined in the $SBT_HOME/sbt/bin/sbt-launch-lib.bash
as
addDebugger () {
addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"
}
您可以通过在 Windows 上设置 SBT_OPTS
环境变量来获得相同的结果.
You can achieve the same result by setting the SBT_OPTS
environmental variable on Windows.
像这样运行 SBT,让调试器监听 5005 端口
Run SBT like this, to make the debugger listen on port 5005
set SBT_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" && sbt
这篇关于如何在 Windows 中启用 SBT 远程调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!