Over a million developers have joined DZone.

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.

Learn more about how the Java language, tools and frameworks have been the foundation of countless enterprise systems, brought to you in partnership with Salesforce.

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.

Discover how the Force.com Web Services Connector (WSC) is a code-generation tool and runtime library for use with Force.com Web services, brought to you in partnership with Salesforce.

play framework,activator,typesafe,eclipse

Published at DZone with permission of Siva Prasad Rao Janapati, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}