Play framework support overview

Please note that the Play framework version 1.x is supported by the IntelliJ IDEA version 11. The later versions of IntelliJ IDEA support the Play 2.x version.
Moreover, for the IntelliJ IDEA version 14.0, the Play 2.x framework is merged with the Scala plugin.

The Play framework support in IntelliJ IDEA includes:

An ability to use the play command-line utility (the Play console) right in the IDE.

Coding assistance:

Navigation between the methods of Application.java and the corresponding templates.

Updating templates through the variables of the corresponding Application.java methods.

An alternative way to create an IntelliJ IDEA project for a Play application

As an alternative, you can create a new project for your Play application sources using
File | Import Project | Create project from existing sources and then
add the necessary Play framework assets (<play_dir>\framework\lib and
<play_dir>\framework\play-<version>.jar) to dependencies of the resulting IntelliJ IDEA module:

As a result, the play command-line utility is started in
the Run tool window.

Adding Play modules to an IntelliJ IDEA module

The Play modules used by your Play application should be added to the corresponding IntelliJ IDEA module as
the module content roots.
For example, if your application uses (or is about to be using) the Play module secure:

On the Module page shown in the right-hand part of the dialog,
select the Sources tab and click Add Content Root.

In the Select content root directory dialog, go to the Play framework installation folder,
select the directory modules\secure, and click OK.
(If the Play module you want isn't included in the Play framework distribution,
you should download that module first to make it available locally.)

Creating a run/debug configuration for debugging

Open the Run/Debug Configurations dialog (e.g. Run | Edit Configurations).

Click (Alt+Insert) and select Remote.

In the Port field, specify 8000.
(This is the port to which a Java debugger will connect.
By default, the Play framework uses the port 8000.)

If necessary, change the run/debug configuration name and click OK.

Modifying the run configuration for running the application

If you are using an IntelliJ IDEA run configuration for running your Play application,
this configuration has to be modified so that a Java debugger could connect to the running application.
This is done by adding the corresponding JVM options.
The necessary options can be copied from the run/debug configuration intended for debugging.

Open the Run/Debug Configurations dialog (e.g. Run | Edit Configurations).

In the left-hand pane of the dialog, select the run/debug configuration intended for debugging.

Click to the right of the upper field containing JVM command-line arguments.
As a result, the field contents are copied to the clipboard.

Select the run configuration for running the application, and paste the options into the VM options field.
This field should finally contain
-Dapplication.path=".", then a space and then the options you've just pasted. Here is an example: