The java-buildpack is a [Cloud Foundry][] buildpack for running JVM-based applications. It is designed to run many JVM-based applications ([Grails][], [Groovy][], Java Main, [Play Framework][], [Spring Boot][], and Servlet) with no additional configuration, but supports configuration of the standard components, and extension to add custom components.
To use this buildpack specify the URI of the repository when pushing an application to Cloud Foundry:
$ cf push <APP-NAME> -p <ARTIFACT> -b https://github.com/cloudfoundry/java-buildpack.git
The following are very simple examples for deploying the artifact types that we support.
The buildpack default configuration can be overridden with an environment variable matching the configuration file you wish to override minus the .yml extension. It is not possible to add new configuration properties and properties with nil or empty values will be ignored by the buildpack (in this case you will have to extend the buildpack, see below). The value of the variable should be valid inline yaml, referred to as "flow style" in the yaml spec ([Wikipedia][] has a good description of this yaml syntax).
There are two levels of overrides: operator and application developer.
JBP_DEFAULT.JBP_CONFIG. Here are some examples:
$ cf set-staging-environment-variable-group '{"JBP_DEFAULT_OPEN_JDK_JRE":"{jre: {version: 11.+ }}"}'
$ cf set-staging-environment-variable-group '{"JBP_DEFAULT_REPOSITORY": "{default_repository_root: \"http://repo.example.io\" }"}'
JBP_CONFIG_COMPONENTS for JRE selection is no longer supported in the Go buildpack.# Use this instead
$ cf set-staging-environment-variable-group '{"JBP_DEFAULT_ZULU_JRE":"{jre: {version: 17.+ }}"}'
$ cf set-env my-application JBP_CONFIG_OPEN_JDK_JRE '{ jre: { version: 11.+ }, memory_calculator: { stack_threads: 25 } }'
: it should be escaped with double quotes. For example, to change the default repository path for the buildpack.$ cf set-env my-application JBP_CONFIG_REPOSITORY '{ default_repository_root: "http://repo.example.io" }'
$ cf set-env my-application JBP_CONFIG_JAVA_MAIN '{ arguments: "--server.port=9090 --foo=bar" }'
javaagent that is packaged within an application.$ cf set-env my-application JAVA_OPTS '-javaagent:app/META-INF/myagent.jar -Dmyagent.config_file=app/META-INF/my_agent.conf'
manifest file. For example, to specify an environment variable in an applications manifest file that disables Auto-reconfiguration.env:
JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{ enabled: false }'
env:
JBP_CONFIG_TOMCAT: '{ tomcat: { version: 8.0.+ } }'
See the [Environment Variables][] documentation for more information.
Important: The Go buildpack does NOT support JBP_CONFIG_COMPONENTS for JRE selection (this differs from the Ruby buildpack). This environment variable is deprecated in favor of using JRE-specific configuration variables.
To select a different JRE, use the appropriate JBP_CONFIG_<JRE_NAME> variable:
# Switch to SapMachine JRE
$ cf set-env my-app JBP_CONFIG_SAP_MACHINE_JRE '{ jre: { version: 17.+ }}'
# Switch to Zulu JRE
$ cf set-env my-app JBP_CONFIG_ZULU_JRE '{ jre: { version: 21.+ }}'
# For BYOL JREs (Oracle, GraalVM, IBM, Zing), you must first add them to manifest.yml
# See https://github.com/cloudfoundry/java-buildpack/blob/main/docs/custom-jre-usage.md
The buildpack will automatically detect and use the configured JRE without requiring JBP_CONFIG_COMPONENTS.
See the [Environment Variables][] documentation for more information.
To learn how to configure various properties of the buildpack, follow the "Configuration" links below.
The buildpack supports extension through the use of Git repository forking. The easiest way to accomplish this is to use [GitHub's forking functionality][] to create a copy of this repository. Make the required extension changes in the copy of the repository. Then specify the URL of the new repository when pushing Cloud Foundry applications. If the modifications are generally applicable to the Cloud Foundry community, please submit a [pull request][] with the changes. More information on extending the buildpack is available here.
This Go-based buildpack is a migration from the original Ruby-based Cloud Foundry Java Buildpack. For comprehensive information about the migration status, component parity, and architectural differences:
⚠️ Important Migration Note: The Go buildpack does NOT support the Ruby buildpack's repository_root configuration approach for custom JREs (via JBP_CONFIG_* environment variables). Custom JREs now require forking the buildpack and modifying manifest.yml. See Custom JRE Usage for details.
Quick Status Summary (as of December 16, 2025): - ✅ All 8 container types implemented (100%) - ✅ All 7 JRE providers implemented (3 in manifest + 4 BYOL via custom manifest) - ✅ 37 of 40 frameworks implemented (92.5%) - ✅ All integration tests passing - ⚠️ Only 3 missing frameworks are niche/deprecated (affecting <2% of applications) - 📝 BYOL JREs (GraalVM, IBM, Oracle, Zing) require custom manifest - see Custom JRE Usage
For historical analysis documents from development sessions, see docs/archive/.
$ claude mcp add java-buildpack \
-- python -m otcore.mcp_server <graph>