
<font color="#ff0000">UPDATE: This tutorial is for Play 1.x (an old version). Check out my <a href="http://www.jamesward.com/2012/05/08/play-2-java-tutorial">Play 2 Tutorial</a> if you want to get started with the latest stuff.</font>

Last week Heroku announced that [you can now run Java apps on Heroku][1]. Today [Heroku announced][2] that you can also easily run [Play Framework][3] apps on Heroku! Here's a quick guide to getting started with Play! on Heroku:

  1. Install the heroku command line client on [Linux][4], [Mac][5], or [Windows][6].
  2. Install [git][7] and setup your SSH key
  3. [Install Play! version 1.2.3][8]
  4. Login to Heroku from the command line:
    ```bash
    heroku auth:login
    ```

  5. Create a new Play! app:
    ```bash
    play new play_hello_world
    cd play_hello_world
    ```

  6. Run the app locally to test it:
    ```bash
    play run --%production
    ```

  7. Create a git repo, add the files, and commit:
    ```bash
    git init
    git add app conf lib public test
    git commit -m init
    ```

  8. Create a new app on Heroku:
    ```bash
    heroku create -s cedar
    ```

  9. Push the app to Heroku:
    ```bash
    git push heroku master
    ```

 10. Open the app in your browser:
    ```bash
    heroku open
    ```

That's it! If you want to learn more about Heroku, check out the [Heroku for Java Workbook][9] and the [Heroku Dev Center][10]. And if you are at Dreamforce 2011 then check out [Felipe Oliveira's][11] session on "Introducing Play! Framework: Painless Java and Scala Web Applications" on Wednesday at 3:30pm.

Let me know what you think and if you have any questions.

 [1]: http://www.jamesward.com/2011/08/25/heroku-adds-java-support "Heroku Adds Java Support"
 [2]: http://blog.heroku.com/archives/2011/8/29/play/
 [3]: http://www.playframework.org
 [4]: http://toolbelt.herokuapp.com/linux/readme
 [5]: http://toolbelt.herokuapp.com/osx/download
 [6]: http://toolbelt.herokuapp.com/windows/download
 [7]: http://git-scm.com/
 [8]: http://www.playframework.org/download
 [9]: https://github.com/heroku/java-workbook
 [10]: http://devcenter.heroku.com/
 [11]: http://geeks.aretotally.in/

