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.
Join the DZone community and get the full member experience.Join For Free
In this article, we will see how to export a Play project as an Eclipse project. To do that follow these steps.
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")
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.
Export the project into Eclipse.
Now you can use Eclipse as your IDE to work with Play project. You can modify/add the code by using Eclipse.
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
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.
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.