Play Framework and IntelliJ IDEA 13

IntelliJ IDEA 13 has been released! My favorite new feature is the sbt project support that alleviates the need to generate project files for Play Framework apps. Here is a short screencast that will show you how to create a new Play app with Typesafe Activator and then open that project in IntelliJ IDEA 13:

Pretty sweet stuff!

  • Pierre

    Nice ! Just for my information what is the screencast software you made this video with ?

    • Thanks! I used Camtasia to record this.

      • Pierre

        Ah ok, thank you for this information.

  • Roger

    Hrm.. so if I have a pre-existing Play 2.2.1 application.. that I load up “into” activator (it was created long before activator existed etc etc).
    Once that is done, I *do not* have a build.sbt file to open in intellij.

    • Can you open the project dir and see if IntelliJ lets you open the Build.scala file?

      • Roger

        Open it how? There is a Build.scala file in my ~/project_dir/project folder.. but i’m not sure by what workflow you want me to open it.
        I can’t “import or open” the “project” Build.scala so to speak.

        • Maybe they only support .sbt files. What if you create an empty build.sbt file in your projects root dir? Does that work?

          • Roger

            I’ll give the tentative thumbs up for now (it took quite a long time, but the empty build.sbt in ~/project_dir did the trick). I’ll kick the tires/report back.

          • Nice! Seems like Jet Brains still has a bit more work to do. But glad it worked!

  • Jeremias

    Hello James,

    I used version 1.x Play on some projects I’ve done, but now I’m starting a new project and I’m having some doubts I wonder if you can help me?

    You find valid start a new project still in Play 1.x?

    On the automatic generation of CRUD Play 1.x there any alternative in Play 2.x? Any Module / Plugin?

    About scheduling tasks it was possible the Play Play 1.x 2.x features something?

    I thank the attention.

  • Anderson Soares

    Hi James, big fan of you. I don`t know why, but Play 2.0 plugin is not showing to me on the list. Maybe because i have IDEA Community Edition ? I already installed scala plugin. :/

    • Yeah, the Play plugin is only available in the commercial version. But it shouldn’t be necessary to do what I showed in the video.

  • David

    Hi, I created new sample app following the video. I imported it in IDEA, but IDEA cannot resolve imports.

    Error: It cannot resolve symbol ‘mvc’. (in import play.mvc.Controller)

    • Make sure your `build.sbt` has `javaCore` in the `libraryDependencies`.

  • Awesome tutorial. Saved me from the headache of creating a new project and having conflicting SBT updates. Thanks!

  • ID

    So useless! It would be better to show how to attach a debugger from IntelliJ to a running Play application.

    • Thanks for the feedback. To attach a debugger run:
      activator -jvm-debug 9999 ~run

      Then setup a Remote Debug launcher in IntelliJ that connects to port 9999.

  • singhakash