简体   繁体   中英

How to debug play framework with sbt/eclipse

Reading the doc, it looks pretty easy to do that. I should only need to start the application with

sbt -jvm-debug 9999 run

But, I do have this error message :

[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
  • Play : Version 2.6.x
  • SBT : Version 1.0
  • OS : Windows 10

As a workaround, I added the following line

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

in the file

sbtconfig.txt

And simply start the application with

sbt run

You`ll see the trace :

Listening for transport dt_socket at address: 9999

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM