Getting Started with Play 2.0 in IntelliJ IDEA 12

As you know the new release of IntelliJ IDEA finally comes with support for Play 2.0, a popular Java and Scala framework for web development.

The support brings new project wizard, run/debug configurations and code assistance for Scala templates and routes, with code completion, navigation and on-the-fly code analysis.


Now you don’t need to switch between IntelliJ IDEA and Play console anymore. Everything is available right from your favorite IDE.

To enable support for Play 2.0, you need to install the plug-in from the repository.

Check also a quick tutorial showing how to create and run a simple Play 2.0 application from IntelliJ IDEA.

As always very welcome with suggestions and feedback on the discussion forum and in our issue tracker.

Develop with Pleasure!

About Andrey Cheptsov

Andrey Cheptsov is IntelliJ IDEA product marketing manager at JetBrains. He's passionate about productivity, programming languages and tools.
This entry was posted in New Features and tagged , , , . Bookmark the permalink.

46 Responses to Getting Started with Play 2.0 in IntelliJ IDEA 12

  1. John says:

    Nice!! Was trying to figure out this integration last night. Very timely. Thanks.

  2. Maggie Leber says:

    And here I’ve been bumping along without the 2.0 plugin. Good tip…

  3. Kevin says:

    Help me, Play 2.0 plugin does not show up in the repository on intelliJ here?

  4. AntonKulaga says:

    Play framework plugin does not work. I’ve installed it together with another playframework plugin but I do not see any play console in tools and there is no highlightning in the templates of my idea play projects.

  5. Jon says:

    Dealing with dependencies within Intellij with Play projects is a bit of a nightmare. is there any help for this? When I add a new dependency, it seems as though I have to do all the work to add it, and all the dependent libraries to the project. Is that the case?

  6. stefan says:

    I’ve tried for several hours to setup intelliJ with a play app but failed.
    I receive numerous errors, no template code highlighting, etc. I am uncertain as to what the actual problem is. Is there a good step-by-step tutorial on how to setup IntelliJ for Play! apps? The one on the play homepage didn’t help.

  7. stefan says:

    Sample errors:
    Cannot resolve method ‘ok(?)’
    Cannot resolve symbol ‘index’

  8. Andrey Cheptsov says:

    @stefan Actually a link to the tutorial is attached to the blog entry: http://confluence.jetbrains.com/display/IntelliJIDEA/Play+Framework+2.0

  9. Lev says:

    Where can I find Play console in IDEA for Play 2 framework?

  10. Andrey Cheptsov says:

    @Lev, it is supposed that you don’t need it anymore, and the IDE provides what you need (e.g. run, compile, etc).

  11. Lev says:

    Is there a way to generate ER diagram of Play 2 model?

  12. Egor says:

    Play 2.0 plugin does not show up in the repository on intelliJ. Why?

  13. Lev says:

    How to debug Play 2.0 application with IDEA 12?

    When I run “Debug” command it acts the same way as “Run” starting Play on a usual port, but not on Debug Port.

  14. tim says:

    Same issue here, play2 runner does not start the debug port…

  15. Lev says:

    Is it possible to debug play 2 apps with IDEA?

  16. Mike says:

    Hi.

    Actually it seems not to work with Play 2.1, but will it soon ?

    Thanks.

  17. Lesly says:

    I am having the same problem as @Egor: Play 2.0 plugin does not show up in the repository on intelliJ. Please respond to us.

  18. Andrey says:

    @Egor and @Lesly

    One of the reasons why Play 2.0 plug-in will not show-up in the repository is the edition of IntellJ IDEA you are running. It is supported in Ultimate edition only.

  19. Brian says:

    I am student planning to apply for an Academic license for IntelliJ idea. Will this verison include support for the Play framework as that is what I need IntelliJ for?

  20. Andrey Cheptsov says:

    @Brian, sure. It will include everything what is available in IntelliJ IDEA Ultimate.

  21. Adel says:

    I am having a problem when I attempt to create a new Play framework project. I am evaluating IDEA 12. When I attempt to create a new Play project I do not see it as an option.

  22. Adel says:

    Relating to my previous question: I am using IDEA 12 Ultimate

  23. Adel says:

    I also installed IDEA 12.1 EAP Ultimate to try to create Play framework projects with no success.. I dont even see it as an option…Also, when I try to use “Add Framework support” to an existing Play! project, the play framework is not even listed…

  24. Adel says:

    Additional info relating to my posts above: I am using Mac OSX Lion

  25. GJ says:

    Yep, play support seems to be broken. Using play framework 2.1 and IntelliJ build 123.169. Currently evaluating Ultimate Edition and will not be able to purchase license until I can evaluate play support. Hopefully JetBrains can update us as to when it will be fixed.

  26. Andrey Cheptsov says:

    @GJ Says: Have just checked Play support on 128.18 and everything works smoothly for me. Could you please add more details to the ticket, or try to double check if you have updated the plugin.

  27. Adel says:

    Additional info relating to previous comments: I am also using play 2.1…
    I also tried uninstall and reinstall of IDEA 12 Ultimate (and EAP) no success with Play support…I also tried to update the Play support plugin by downloading it and installing it via “Downloaded Plugins” feature..with no success either…So I am going to hold off recommending IDEA 12 Ultimate for my company.

  28. GJ says:

    Hi, just installed latest version from website. Chose all default settings when installing. Checked plugins screen to ensure Playframework was checked. When I select New Project I am presented with the list of project types but Play is not listed. If I open an existing play project I don’t get any of the play features.

    Running Windows 7 64bit

  29. Pete says:

    Same with me as with last couple of posters. I am on latest 12.0.4 Ultimate and trying to create/import Play 2.1.0 with no luck. Create new project shows no Play module and when trying to import existing Play project ( which has been morphed into Idea project with stb) gives me message no frameworks were detected. Hope this is going to get fixed asap.

  30. Adam says:

    I have the same problem – no Play Module available in Create New Project. Play 2.1.0 and Ultimate 12.0.4 (evaluation). I can’t buy unless this is fixed. Any news on a solution?

  31. Brian says:

    I have the same problem, no Play module shows in Create New Project. I bought IntelliJ purely for its Play support so this is a critical issue for me. What is the latest information on this problem?

  32. jelmer says:

    I deleted

    ~/Library/Application Support/IntelliJIdea12/
    ~/Library/Caches/IntelliJIdea12/

    that solved it for me. Probably some other plugin that is causing a conflict

  33. Dmitry says:

    Did you try 12.1? It should be fixed there

  34. Andres says:

    +1 for dependency management problems. I add a dependency to the ApplicationBuild project. Play2 is happy but Intellij does not update the module libraries leaving a trail of red underlines in its wake. What am I supposed to do?

  35. Sergei says:

    Is Play 2.0 plugin available in Community Edition?

  36. Erik says:

    New Play 2 Module,
    Make ->

    object index is not a member of package views.html
    Ok(views.html.index(“Your new application is ready.”))

    in Application.scala

    Installed the Play 2 framework plugin from the repository as I had no “Play 2″ option in the project wizard from start.

    Other than that this should pretty much be the bare bone, clean install test.

    Using Play 2.1.2 and Scala 2.10.0, IntelliJ 12.1.4

    I’m at loss. Like others I heard about the great play support in IntelliJ and wanted to try it out, looks like I’m back to vim.

  37. Andrey Cheptsov says:

    @Erik, which version of Play 2 plugin did you try?

  38. John says:

    Erik, I had the same problem. I noticed that target/scala-2.10/src_managed/main was in the excluded folders list in the project settings->modules->sources tab. I removed it from excluded list and added it as a source folder. Once these managed source files (which play auto generates) were added, the project compiled and ran fine for me. Good luck…

  39. John says:

    Hold that – I don’t know how to get it to generate code for new views. In trying to figure it out, I removed the dozens of SBT-…jar libraries which were created by the new project wizard (thinking my dependency list should look like the tutorial), but now I can’t figure out how to add them back. Isn’t there a proper facet for play support? or is there just the initial library setup for a scala module?
    It would be nice if I just added (or it autodetected) a facet for play where I could generate the library dependencies – and if a project build would generate the managed code.
    I’ll try to work around it until 13…(IntelliJ editor and build/run from a shell)…

  40. John says:

    Ignore my comments – I updated the plugin to the latest nightly build, deleted the .idea and .idea_modules, recreated them with play idea (from the terminal/shell), had to fix up the generated scala libraries in the dependencies in IntelliJ, and it seems to be working great. My project has two modules now – one which builds the app directory, and one (with a -build suffix) which is building the generated code. seems to be working fine.
    Forgive the inexperience, just starting to learn play – as well as the play support in 12.

  41. Ivan says:

    I have the same issue as Erik said. I’ve just invoked “Make Project” and got the error:
    object index is not a member of package views.html
    Ok(views.html.index(“Your new application is ready.”))
    ^
    Using Idea – IU-129.549, Play – 2.1.1, Scala 2.10.0

  42. mamatucci says:

    to fix
    Ok(views.html.index(”Your new application is ready.”))

    >go in the folder where IJ created the sample app that fails to ocmpile
    >go in the folder structure and delete all the file
    >create a new one with same name
    ex play new myApp
    > reopen IJ (it will reopen th solutiona dn it will works)

    // if not working intall the latets play 2.1.2…

  43. Gergely says:

    Hi folks.

    For anybody who might be interested in a solution for not being able to create a project or open one for that matter with IntelliJ UI 12.1.4 here is a SOLUTION =>
    ( At least a possible one… ;) )
    For me the solution was that I let intelliJ download and install PlayFramework 2.1. After this I was able to switch to my downloaded version.
    So when you create a project on the right side there is a Download button. You can select from there the play version you want to install. Select 2.1 and create the project.

    After this I was able to manipulate the version of play to that of the one that I downloaded manually.

    I hope this helped somebody at least one person that it was worth it. :)

    Cheers,
    Gergely.

  44. San_Krish says:

    i couldnt find the play support in the repositories .. please help me out with the issue
    thankx in advance

  45. Jana says:

    How I install the plugin?
    I have already installed the plugin, its shows error that “plugin for intellij unltimate”

    Plz help me quick

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">