Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Eclipse with Play Framework 2.0

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.

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?

A similar question: Debug Playframework 2.0 in Eclipse

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

like image 612
Joe Avatar asked Apr 06 '12 03:04

Joe


People also ask

How do I run a play framework in Eclipse?

Generate configuration To debug, start your application with sbt -jvm-debug 9999 run and in Eclipse right-click on the project and select Debug As, Debug Configurations. In the Debug Configurations dialog, right-click on Remote Java Application and select New. Change Port to 9999 and click Apply.

Which IDES can be used for play applications?

Play supports the NetBeans, IntelliJ IDEA and Eclipse platforms.

Is play a Java framework?

Play is a high-productivity web application framework for programming languages whose code is compiled and run on the JVM, mainly Java and Scala. It integrates the components and APIs we need for modern web application development.

How do I run play framework in Windows?

To run the Play framework, you need JDK 6 or later. If you are using MacOS, Java is built-in. If you are using Linux, make sure to use either the Sun JDK or OpenJDK (and not gcj, which is the default Java command on many Linux distros). If you are using Windows, just download and install the latest JDK package.


1 Answers

Question 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.

Question 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 Explorer and choose Debug As -> Debug Configurations....

  3. A new dialog called Debug Configurations will open. Double-click on Remote Java Application and a new window will appear on the right side. Change the Connection properties so that the point to host localhost and port 9999. Confirm by clicking the Debug button.

  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.

like image 159
Franz Avatar answered Oct 25 '22 10:10

Franz