Deep-dive on the Next Gen Platform. Join the Webinar!

Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • 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
Hide categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Working with Node.js
      • Troubleshooting Node.js Apps
      • Node.js Behavior in Heroku
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Working with AI
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • 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
  • Java
  • Heroku Java Support Reference

Heroku Java Support Reference

English — 日本語に切り替える

Last updated May 06, 2025

Table of Contents

  • Specifying a Java Version
  • Supported Java Versions
  • Specifying an OpenJDK Distribution
  • Upgrading Your Java Version
  • Behavior
  • Customer Support
  • Additional Reading

Heroku can run Java applications across a variety of Java implementations and includes support for framework-specific workflows. This document contains version support info.

For general behavior info of Heroku recognizes and executes Java applications, see Heroku Java Behavior. General Java support on Heroku refers to the support for all frameworks.

For framework-specific tutorials, see:

  • Getting Started on Heroku with Java (Maven)
  • Getting Started on Heroku with Java (Gradle)
  • Java Tutorials

Specifying a Java Version

We recommend always explicitly configuring the required OpenJDK major version for your application. If you don’t configure a version, the default version for the stack is installed. The default version will change over time and your application might fail to build with the new default version.

The current default versions for each stack are:

heroku-22 heroku-24
OpenJDK 8 Latest LTS (currently OpenJDK 21)

To explicitly configure the OpenJDK version, add a file called system.properties to your application. Within that file, set the java.runtime.version property to the OpenJDK major version for your app:

java.runtime.version=11

See the supported Java versions table for accepted major versions.

You can also pin your OpenJDK version to a full version. We don’t recommend this, unless there is a strong reason to do so. Pinning to a full version will cause your app to not automatically get OpenJDK security updates on each build.

To use a full version, set the java.runtime.version property to the full version string:

java.runtime.version=1.8.0_412

Supported Java Versions

Refer to the table for the latest available version for each OpenJDK major version and Heroku stack. The selected OpenJDK version is bundled with your app and affected the final app size.

Rows marked up with red text and background indicate an OpenJDK version that is fully end-of-life and no longer receiving updates of any kind from the upstream maintainers and is no longer supported by Heroku.

OpenJDK Version heroku-22 heroku-24
OpenJDK 7 1.7.0_352 -
OpenJDK 8 1.8.0_452 1.8.0_452
OpenJDK 11 11.0.27 11.0.27
OpenJDK 13 13.0.14 -
OpenJDK 15 15.0.10 -
OpenJDK 17 17.0.15 17.0.15
OpenJDK 18 18.0.2.1 -
OpenJDK 19 19.0.2 -
OpenJDK 20 20.0.2 -
OpenJDK 21 21.0.7 21.0.7
OpenJDK 22 22.0.2 22.0.2
OpenJDK 23 23.0.2 23.0.2
OpenJDK 24 24.0.1 24.0.1

Specifying an OpenJDK Distribution

Heroku supports builds of OpenJDK from either Azul® Zulu® or Heroku. Both distributions are built from the same source and are fully compliant with the Java SE specification. Azul® Zulu® builds of OpenJDK are also TCK/JCK certified and are our recommended OpenJDK distribution.

The default distribution of OpenJDK on Heroku is Azul® Zulu®.

Heroku’s builds of OpenJDK are only available for Cedar-generation apps.

Using a Non-default Distribution

To use a non-default distribution with your app, you must specify a Java version. Prefix the version string with either heroku- or zulu- to select the respective distribution.

To use OpenJDK 11 and explicitly select Azul® Zulu® as the OpenJDK distribution, add the following to system.properties:

java.runtime.version=zulu-11

Upgrading Your Java Version

When you deploy a Java app, the app automatically upgrades to the latest available OpenJDK version. The version doesn’t upgrade if you don’t redeploy the app or if you configure a full version string in the system.properties file.

Specifying a Maven Version

Heroku supports the Maven Wrapper, which is the recommended mechanism for defining a Maven version. If Heroku detects an mvnw file in the root directory of your repository, it uses this script to launch the Maven process.

You can also specify a Maven version with the system.properties file by setting a maven.version property:

maven.version=3.9.4

If you define this property, Heroku ignores the mvnw script. We don’t upgrade your app to a new version automatically and you must update your system.properties file to get a new version.

The default version, if you don’t specify a version and don’t use Maven Wrapper, is 3.9.4. This default changes over time and we recommend using Maven Wrapper to ensure stable builds.

See the Working with Maven category for more info on Maven.

Default Web Process Type

The Java buildpack automatically detects the use of the Spring Boot web framework. For Spring Boot, it creates a web process type with the following command:

java -Dserver.port=$PORT $JAVA_OPTS -jar target/*.jar

You can override this default or define a custom process type using a Procfile. The appropriate command depends on your app and the frameworks in use. See one of the Java tutorials for information on setting up your Procfile.

Behavior

See Heroku Java Behavior behavior info.

Customer Support

You can submit issues via one of the Heroku Support channels.

Additional Reading

  • Warming Up a Java Process
  • Running Database Migrations for Java Apps
  • Reducing the Slug Size of Java Applications
  • Working with Maven category
  • Working with Spring Boot category

Keep reading

  • Java

Feedback

Log in to submit feedback.

Information & Support

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

Language Reference

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

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices