I want to run Play Framework 2.x in debug mode in IntelliJ IDEA. I searched in the Internet and all results say that you have to use play console.
Is it possible to run in debug mode in IntelliJ IDEA without using play console?
To debug, start your application with activator -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.
Run the program in debug mode Click the Run icon in the gutter, then select Modify Run Configuration. Enter arguments in the Program arguments field. Click the Run button near the main method. From the menu, select Debug.
Open an existing Play 2 project In the dialog that opens, locate your project and if it is an sbt project, select the build. sbt file and click Open. In the dialog that opens, click Open as Project. IntelliJ IDEA opens the project and loads all the necessary dependencies.
To run a Play application: Create a new Run Configuration – From the main menu, select Run -> Edit Configurations. Click on the + to add a new configuration. From the list of configurations, choose “sbt Task”
Using activator :
Generate
Open Intellij IDEA
You need to use Idea 12+ Ultimate Edition
play idea
to generate projectPreparation: Do not use the project creation by activator ui or similar. Just open the project in IntelliJ.
activator -jvm-debug 9999 ~run
. The ~
before run
enables automatic reloading of generated HTML pages9999
as port
Pro hint: Check out the play-auto-refresh plugin to have Chrome automatically reloading on a change.
(based on @ARM's answer)
FYI : All of the above fields might filled up already
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With