如何在Windows中为SBT启用远程调试? [英] How can I enable remote debugging for SBT in windows?

查看:380
本文介绍了如何在Windows中为SBT启用远程调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想完成相同的运行

  sbt -jvm-debug 5005 

但是我似乎无法在Windows中传递args。这就是我所看到的

 > sbt -jvm-debug 5005 
[info]从[加载项目定义] myProject]
[info]将当前项目设置为[myProject](在构建文件myProject中)
[错误]预期字母
[错误]预期符号
[错误]预期'! '
[错误]预期'+'
[错误]预期'++'
[错误]预期';'
[错误]预期输入结束。
[错误]预期'显示'
[错误]预期'*'
[错误]预期'{'
[错误]预期项目ID
[错误]预期配置
[错误]预期键
[错误] 5005
[错误] ^
[错误]无效命令:jvm-debug
[错误]不一个有效的项目ID:jvm-debug
[错误]预期':'(如果选择配置)
[错误]不是有效密钥:jvm-debug
[错误] jvm-debug
[错误] ^

我希望能够从Intellij远程调试此应用程序。任何帮助都会很棒!

解决方案

似乎Windows版本的SBT没有定义此功能。



在Linux上,它在 $ SBT_HOME / sbt / bin / sbt-launch-lib.bash 中定义为

  addDebugger(){
addJava-Xdebug -Xrunjdwp:运输= dt_socket,服务器= Y,暂停=正,地址= $ 1
}

您可以通过设置<$来获得相同的结果c $ c> SBT_OPTS Windows上的环境变量。



像这样运行SBT,使调试器监听端口5005



'pre> 设置SBT_OPTS = - Xdebug的-Xrunjdwp:运输= dt_socket,服务器= Y,暂停= n时,地址= 5005 &安培;&安培; sbt


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!

解决方案

Seems like the Windows version of SBT doesn't define this functionality.

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" 
}

You can achieve the same result by setting the SBT_OPTS environmental variable on Windows.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆