Skip to content

Issue 1270 fix: use default JRE version when memory_calculator settings only#1274

Open
stokpop wants to merge 1 commit into
cloudfoundry:mainfrom
stokpop:issue-1270-jre-version-fallback-when-only-memory-calc-set
Open

Issue 1270 fix: use default JRE version when memory_calculator settings only#1274
stokpop wants to merge 1 commit into
cloudfoundry:mainfrom
stokpop:issue-1270-jre-version-fallback-when-only-memory-calc-set

Conversation

@stokpop
Copy link
Copy Markdown
Contributor

@stokpop stokpop commented May 15, 2026

Problem

When JBP_CONFIG_*_JRE is set with only memory_calculator settings (no version field), staging hard-fails with:

Failed to install JRE: could not parse version from JBP_CONFIG_OPEN_JDK_JRE='{ memory_calculator: { class_count: 30000 } }'

The env var is valid for configuring memory calculator tuning without pinning a version. Staging should continue with the manifest default version.

This affects all JREs (OpenJDK, SapMachine, Zulu, IBM, Oracle, GraalVM) since GetJREVersion() is shared.

Fix

In GetJREVersion(): when parseJBPConfigVersion returns an empty string, log a debug message and fall through to the manifest default instead of hard-erroring.

Tests

Added two tests for this behaviour:

  • falls back to default version when only memory_calculator is set — the primary regression case
  • falls back to default version when config format has no version — covers the general case where no version field is present

Fixes #1270

When JBP_CONFIG_*_JRE contains only memory_calculator settings (no version),
GetJREVersion() was hard-failing with 'could not parse version'.

Now: if parseJBPConfigVersion returns empty string, log debug and fall through
to manifest default version.

Fixes: https://github.com/stokpop/java-buildpack/issues/1270
@stokpop stokpop changed the title fix: fall back to default JRE version when only memory_calculator is set Issue 1270 fix: use default JRE version when memory_calculator settings only May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JBP_CONFIG_OPEN_JDK_JRE with only memory_calculator settings fails to stage

1 participant