Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Export a Play Project as an Eclipse Project

DZone's Guide to

Export a Play Project as an Eclipse Project

A helpful tutorial that shows how to export a Play project as an Eclipse project in a few easy steps.

· Java Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

Play Framework - Build Modern & Scalable Web Apps with Java and Scala

In this article, we will see how to export a Play project as an Eclipse project. To do that follow these steps.

Step 1

Add the SBT Eclipse plugin details to the plugins.sbt file, which is found in <Root_Project_Folder> –> project.

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

Step 2

Move to the project root folder on the command prompt and run the following Activator command.

D:\My_Learnings>cd Learning_Play_App
D:\My_Learnings\Learning_Play_App>activator eclipse

Now you can see the Eclipse project related files in the root project folder.

Step 3

Export the project into Eclipse.

Play Eclipse Project

Now you can use Eclipse as your IDE to work with Play project. You can modify/add the code by using Eclipse.

Step 4

Open the command prompt and move to the project root folder to start the Play application. Modify/add the code from Eclipse and refresh the page to see the update. There's no need to restart the Play application for changes you make in Eclipse.

D:\My_Learnings>cd Learning_Play_App
D:\My_Learnings\Learning_Play_App>activator run

Step 5

Sometimes we may need to debug the application in Eclipse. For that, we need to launch the Play project in debug mode and do the debug configurations in Eclipse. From the command prompt, move to the project’s root folder and launch the application in debug mode.

D:\My_Learnings>cd Learning_Play_App
D:\My_Learnings\Learning_Play_App>activator -jvm-debug 9999 run

I have used “9999” as the port to debug. You can use any available port there.

Now, you can go ahead and do “Debug Configurations” by providing “9999” as the port.

You are ready to use your favorite IDE for Play Java application development.

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:
play framework ,activator ,typesafe ,eclipse

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}