如何使用激活器调试Play应用程序? [英] How to debug Play application using activator?

查看:154
本文介绍了如何使用激活器调试Play应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道对于经典的Play框架,它是play debug ~run.我尝试运行activator debug ~run,但出现以下错误:

I know that for the classic Play framework it's play debug ~run. I tried running activator debug ~run but I get the following error:

[error] Not a valid command: debug (similar: idea)
[error] Not a valid project ID: debug
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: debug (similar: debianSign, node)
[error] debug
[error]      ^

我在做什么错了?

推荐答案

如果您只是在做activator ~run,那么您应该能够通过以下方式传递JVM调试端口选项:

If you're just doing activator ~run, then you should be able to pass a JVM debug port option with:

./activator -jvm-debug <port> ~run

这可能与播放运行不一样,但是这是它添加到命令行的参数:

This may not do the same thing as play-run, but here's the arguments it's adding to the command line:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<port>

发件人: https://github.com/typesafehub/activator/blob/master/dist/src/templates/activator#L107

我已经在我的IDE中成功完成了此过程.

I've successfully attached to this process in my IDE.

如果您在Windows中运行,则自动配置会有所不同.使用最新的激活器,您可以执行以下操作:

If you're running in windows, the automatic configuration is a bit different. With the latest activator, you can do the following:

  1. 打开%UserProfile%\.activator\activatorconfig.txt(根据Windows安装的不同,UserProfile有所不同.在一个安装中,我的用户名是C:\Documents and Settings\jsuereth,在另一个安装中,我的用户名是C:\Users\jsuereth).在文件中粘贴以下内容: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<PUT YOUR PORT HERE>
  2. 您可以在启动激活器之前在命令行上设置JAVA_OPTS属性,例如 set "JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<port>"
  1. Open %UserProfile%\.activator\activatorconfig.txt (The UserProfile is different depending on your windows install. Mine is C:\Documents and Settings\jsuereth on one installation and C:\Users\jsuereth on another). Past the following in the file: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<PUT YOUR PORT HERE>
  2. You can set the JAVA_OPTS property on the command line before starting activator, e.g. set "JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<port>"

希望有帮助!

这篇关于如何使用激活器调试Play应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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