在 Play Framework 2.0 中使用 Eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10038673/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:58:47  来源:igfitidea点击:

Using Eclipse with Play Framework 2.0

eclipseplayframework-2.0

提问by Joe

I am new to Framework 2.0. In Play 1.0, after you Eclipsify your project, you have have a *.launch file that you can use to launch your project.

我是框架 2.0 的新手。在 Play 1.0 中,在 Eclipsify 项目后,您有一个 *.launch 文件,可用于启动项目。

After you eclipsify in Play 2.0, you don't seem to have anything similar. Is there a way to control your launching and to debug Play 2.0, using Eclipse?

在 Play 2.0 中 eclipsify 之后,您似乎没有任何类似的东西。有没有办法使用 Eclipse 控制您的启动和调试 Play 2.0?

A similar question: Debug Playframework 2.0 in Eclipse

一个类似的问题: Debug Playframework 2.0 in Eclipse

The answer to that question did not have specific enough instructions for me to know how to follow.

该问题的答案没有足够具体的说明让我知道如何遵循。

回答by Franz

Question 1:

问题 1:

After you have eclipsified, open Eclipse and choose File -> Import... -> Existing Projects into Workspace. A dialog will open, choose your Play Framework 2.0 project folder and click Finish.

完成 Eclipse 后,打开 Eclipse 并选择File -> Import... -> Existing Projects into Workspace. 将打开一个对话框,选择您的 Play Framework 2.0 项目文件夹并单击Finish

Question 2:

问题2:

  1. Start your Play Framework application using play debug run. You will see something like this:

    Listening for transport dt_socket at address: 9999 ...

  2. In Eclipse, right-click on your project in Project Explorerand choose Debug As -> Debug Configurations....

  3. A new dialog called Debug Configurationswill open. Double-click on Remote Java Applicationand a new window will appear on the right side. Change the Connection propertiesso that the point to host localhostand port 9999. Confirm by clicking the Debugbutton.

  4. Put a breakpoint in your Application in Eclipse.

  5. Try your application as normal in a web-browser. If it hits a breakpoint then Eclipse will be brought as frontmost and let you debug.

  1. 使用play debug run. 你会看到这样的事情:

    在地址侦听传输 dt_socket:9999 ...

  2. 在 Eclipse 中,右键单击您的项目Project Explorer并选择Debug As -> Debug Configurations....

  3. Debug Configurations将打开一个名为的新对话框。双击Remote Java Application,右侧会出现一个新窗口。更改Connection properties以便指向 hostlocalhost和 port 9999。单击Debug按钮确认。

  4. 在 Eclipse 中的应用程序中放置一个断点。

  5. 在网络浏览器中像往常一样尝试您的应用程序。如果它遇到断点,那么 Eclipse 将被置于最前面并让您进行调试。