Skip Navigation
Show nav
Heroku Dev Center Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
Heroku Dev Center Dev Center
  • 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 in or Sign up
View 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
    • Buildpacks
  • Developer Tools
    • AI 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 Rails
      • 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
      • Working with PHP
      • PHP Behavior in Heroku
    • 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
    • Inference Essentials
    • Inference API
    • Inference Quick Start Guides
    • AI Models
    • Tool Use
    • AI Integrations
    • Vector Database
  • 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
  • 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
    • Heroku AppLink
      • Getting Started with Heroku AppLink
      • Working with Heroku AppLink
      • Heroku AppLink Reference
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Other Salesforce Integrations
  • Language Support
  • Java
  • Heroku Java Support Reference

Heroku Java Support Reference

English — 日本語に切り替える

Table of Contents [expand]

  • Specifying a Java Version
  • Supported Java Versions
  • Specifying an OpenJDK Distribution
  • Upgrading Your Java Version
  • Specifying a Maven Version
  • Default Web Process Type
  • Additional Reading

Last updated February 26, 2026

Heroku runs Java applications across a variety of Java implementations with support for framework-specific workflows. This document covers version support and configuration.

For details on how the Java buildpack builds and runs your application, see Heroku Java Behavior.

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 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 changes over time and your application might fail to build with a new default.

The current default versions for each stack are:

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

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 you have a strong reason to do so. Pinning to a full version prevents your app from automatically getting 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_482

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 affects 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_482 1.8.0_482
OpenJDK 11 11.0.30 11.0.30
OpenJDK 13 13.0.14 -
OpenJDK 15 15.0.10 -
OpenJDK 17 17.0.18 17.0.18
OpenJDK 18 18.0.2.1 -
OpenJDK 19 19.0.2 -
OpenJDK 20 20.0.2 -
OpenJDK 21 21.0.10 21.0.10
OpenJDK 22 22.0.2 22.0.2
OpenJDK 23 23.0.2 23.0.2
OpenJDK 24 24.0.2 24.0.2
OpenJDK 25 25.0.2 25.0.2

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, the buildpack ignores the mvnw script. The version isn’t upgraded automatically and you must update your system.properties file to get a new version.

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

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

Default Web Process Type

If your app doesn’t have a Procfile, the buildpack creates a default web process type for recognized frameworks. Spring Boot, Micronaut, and Quarkus are detected automatically.

For Spring Boot, the default process type is:

java -Dserver.port=$PORT -jar target/<app>.jar

You can override this by defining your own web process type in a Procfile.

Additional Reading

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

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
  • © 2026 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