轉換成Eclipse項目
- 啟動命令行,輸入play new <項目名>,Play會在當前路徑下創建項目。
- 輸入play eclipsify <項目名>,Play會在項目目錄中創建eclipse需要的配置文件,將其轉換成eclipse項目。
- 在eclipse中導入創建的項目。

調試
Play轉換eclipse項目時,在eclipse目錄中生成了三個啟動配置:
- JPDA:連接到已經啟動的Play Server,實現alive調試
- helloworld:本地運行
- Test:測試
選中它們,右鍵執行Run As,即可完成相應的任務。
本地調試
直接Debug As 執行helloworld會報錯:
Error occurred during initialization of VM
agent library failed to init: jdwp
ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
需要:
打開helloworld.launch,找到
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dplay.debug=yes -Dplay.id= -Dapplication.path …/>
將-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n 去掉。
然后Debug As,即可成功啟動調試。附加Play源碼后,即可調試Play本身。
轉載于 http://www.cnblogs.com/Chaos/archive/2011/04/16/2018444.html