Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with the Play Framework
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Language Support
  • Scala
  • Heroku Play Framework Support

Heroku Play Framework Support

English — 日本語に切り替える

Last updated April 09, 2020

Table of Contents

  • Activation
  • Build behavior
  • Runtime behavior
  • Supported versions
  • Add-ons
  • Further Reading

Play 1.x is no longer supported.

This document describes the general behavior of the Heroku stack as it relates to the recognition and execution of Play framework applications. Play framework applications written in either Java or Scala can be run on Heroku.

Get started with Scala/Play 2.x on Heroku

Activation

Heroku Play framework support will be applied to applications that match: */conf/application.conf in any directory except for the modules directory

When a deployed application is recognized as a Play application, Heroku responds -----> Play! app detected for Play 1.2.x apps, -----> Play 2.x - Java app detected for Play 2.x Java apps, or -----> Play 2.x - Scala app detected for Play 2.x Scala apps. Play 2.x language detection is based on file count and is for informational purposes only.

$ git push heroku master
-----> Play! app detected

Build behavior

Play 2.x uses sbt to build your application behind the scenes. On Heroku sbt will be called directly to build your app:

sbt compile stage

The following directories are dropped from the slug after compilation, as they are not required at runtime:

  • Ivy cache (persisted between builds of the same app)
  • project/boot
  • target/scala-*
  • target/streams
  • target/resolution-cache

Runtime behavior

Heroku currently uses OpenJDK to run your application. OpenJDK 8 is the default, while other versions are available using a system.properties file. See the Java Tutorials for more information.

Play 2.0.x-2.1.x

A start script is generated by the xbst-start-script-plugin. This start script is used by the default web process definition:

web: target/start -Dhttp.port=$PORT $JAVA_OPTS

Play 2.2+

The default web process is determined by examining output from the native packager plugin. If your app only contains one process, the following default web process is generated:

web: target/universal/stage/bin/{your project name} -Dhttp.port=$PORT

Note: JAVA_OPTS is read by the generated script and does not need to be passed into the process.

Supported versions

Play 2.x relies on sbt dependency resolution so all versions are available as soon as they are released.

Add-ons

A Postgres database is automatically provisioned for Play framework applications. This populates the DATABASE_URL environment variable.

Further Reading

  • Reducing the Slug Size of Play 2.x Applications
  • Running a Remote sbt Console for a Scala or Play Application
  • Using Amazon S3 for File Uploads with Java and Play 2
  • Using Node.js to Perform JavaScript Optimization for Play and Scala Applications
  • Using WebSockets on Heroku with Java and the Play Framework

Keep reading

  • Scala

Feedback

Log in to submit feedback.

Using Node.js to Perform JavaScript Optimization for Play and Scala Applications Heroku Scala Support

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences