In this article, we will see how to export the Play project as an Eclipse project. To do that follow the below steps.
Step 1: Add the SBT Eclipse plugin details to the plugins.sbt file resides under <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 below Activator command.
D:\My_Learnings>cd Learning_Play_App D:\My_Learnings\Learning_Play_App>activator eclipse
Now, you are able to see the Eclipse project related files under the root project folder.
Step 3: 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.
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. No need to restart the Play application for changes which you are doing in Eclipse.
D:\My_Learnings>cd Learning_Play_App D:\My_Learnings\Learning_Play_App>activator run
Step 5: As a developer, some times we require 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 over there.
Now, you can go ahead and do “Debug Configurations” by providing “9999” as the port.
You are done to use your favorite IDE for Play Java application development.