如何使用 sbt/eclipse 调试播放框架

How to debug play framework with sbt/eclipse

阅读文档,这看起来很容易做到。我应该只需要用

启动应用程序
sbt -jvm-debug 9999 run

但是,我收到了这条错误消息:

[info] Loading settings for project play-java-ebean-example-build from plugins.sbt ...
[info] Loading project definition from D:\play\play-java-ebean-example\project
[info] Loading settings for project root from build.sbt ...
[info] Set current project to play-java-ebean-example (in build file:/D:/play/play-java-ebean-example/)
[error] Expected symbol
[error] Not a valid command: -
[error] Expected end of input.
[error] Expected '--'
[error] Expected 'debug'
[error] Expected 'info'
[error] Expected 'warn'
[error] Expected 'error'
[error] Expected 'addPluginSbtFile'
[error] -jvm-debug 9999 run
[error]  ^
[INFO] [12/30/2018 17:19:45.858] [Thread-3] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook

作为解决方法,我添加了以下行

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999

在文件中

sbtconfig.txt

只需使用

启动应用程序
sbt run

您会看到踪迹:

Listening for transport dt_socket at address: 9999