Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala/sbt:在Eclipse中如何在断点处停止_Eclipse_Scala_Debugging_Sbt_Breakpoints - Fatal编程技术网

Scala/sbt:在Eclipse中如何在断点处停止

Scala/sbt:在Eclipse中如何在断点处停止,eclipse,scala,debugging,sbt,breakpoints,Eclipse,Scala,Debugging,Sbt,Breakpoints,我试图在使用sbt运行测试时调试Scala应用程序。我已将以下行添加到build.sbt: javaOptions in test ++= Seq( "-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001" ) 我还在Eclipse中设置了断点,并为该端口8001配置了远程调试器 从命令行启动测试时,远程调试器将正确启动: Listening for transport dt_socket at

我试图在使用sbt运行测试时调试Scala应用程序。我已将以下行添加到
build.sbt

javaOptions in test ++= Seq(
  "-Xdebug",
  "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001"
)
我还在Eclipse中设置了断点,并为该端口8001配置了远程调试器

从命令行启动测试时,远程调试器将正确启动:

Listening for transport dt_socket at address: 8001
但是测试的执行并没有像预期的那样暂停,因此我无法连接远程调试器。相反,测试只是简单地运行


你知道我可能做错了什么吗?如何在Eclipse中使用断点调试sbt测试?

以下内容对我很有用(没有在测试中测试,但可能以相同的方式工作)。在本例中,我使用了由udash生成器(0.3.1)生成的项目

我使用了eclipse(Neon与ScalaIDE 4.4.1、Scala 2.11一起使用)(
sbt eclipse与source=true
),并向
com.example.rpc.ExposedRpcInterfaces.hello(名称:String)
方法添加了一个断点

已创建运行配置:

启动启动配置(eclipse调试器)并用
http://localhost:8080/#/rpc
,开始键入文本字段,eclipse在断点处停止


我不确定对您来说有什么不同,因为您似乎也在为测试派生一个新的JVM。如果您提供更多关于您使用的测试框架的详细信息,我可以尝试您的设置。

M也面临同样的问题
$ sbt
> set fork := true
> set javaOptions ++= Seq("-Xdebug",  "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001")
> run