Skip to content

Configure OpenJDK buildpack to use the same Java version as used for compilation #20172

@scottfrederick

Description

@scottfrederick

The OpenJDK buildpack can be configured to use a specific JRE or JDK version by providing the environment variable $BP_JAVA_VERSION to the builder.

The spring-boot:build-image Maven goal and bootBuildImage Gradle task should set $BP_JAVA_VERSION to match the target Java version used by the build (e.g. the equivalent of maven.compiler.target or java.version in Maven or targetCompatibility in Gradle).

The OpenJDK buildpack requires versions to be provided as whole numbers with wildcards like 8.* or 11.*. It may be necessary to map Maven or Gradle properties in the form 1.8 to form expected by OpenJDK buildpack.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions