You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: correct JRE interface, env var, and example accuracy in IMPLEMENTING_JRES.md
Addresses PR review:
- Add missing MemoryCalculatorCommand() to the jres.JRE interface excerpt.
- Add the missing `type MinimalJRE` so the no-extra-opts example compiles.
- Correct detection/version docs to match DetectJREByEnv/GetJREVersion: the
documented JBP_CONFIG_<NAME>_JRE name (recommended) or the auto-generated
JBP_CONFIG_<KEY> alias. JBP_CONFIG_COMPONENTS is deprecated and unused for
selection; there is no BP_JAVA_<JREKEY> variable.
b := newBaseJRE(ctx, "Minimal JRE", "minimal", []string{"jre"}, nil, "")
187
192
// extraFinalizeOpts left nil — BaseJRE writes only -Djava.io.tmpdir=$TMPDIR
@@ -220,12 +225,13 @@ var _ = Describe("MyJRE", func() {
220
225
221
226
### Detection
222
227
223
-
`BaseJRE.Detect()` calls `DetectJREByEnv(jreKey)` which returns `true` when:
224
-
- `JBP_CONFIG_<JREKEY>_JRE`is set, or
225
-
- `JBP_CONFIG_COMPONENTS`names this JRE, or
226
-
- `BP_JAVA_<JREKEY>`is set
228
+
`BaseJRE.Detect()` calls `DetectJREByEnv(jreKey)` which returns `true` when **either**:
229
+
- the documented `JBP_CONFIG_<NAME>_JRE` name is set (e.g. `JBP_CONFIG_OPEN_JDK_JRE`) — the **recommended** form, defined for each built-in provider in the `jreNameToDocumentedEnvVar` map, or
230
+
- the auto-generated `JBP_CONFIG_<KEY>` alias is set — `jreKey` uppercased with `-` → `_` (e.g. `JBP_CONFIG_OPENJDK`).
231
+
232
+
The documented `_JRE` names originate from the Ruby buildpack and are kept for backward compatibility, but they remain the recommended, fully-supported form: the buildpack points users to them, and (unlike the auto-generated alias) they also drive memory-calculator config. `JBP_CONFIG_COMPONENTS` is **deprecated** and is not used for JRE selection; there is no `BP_JAVA_<JREKEY>` detection variable.
227
233
228
-
Replace `<JREKEY>` with the uppercased `jreKey` value.
234
+
A **new custom JRE** responds only to the auto-generated `JBP_CONFIG_<KEY>` name unless you add an entry to `jreNameToDocumentedEnvVar`.
229
235
230
236
### Running tests
231
237
@@ -243,16 +249,16 @@ These are available in `src/java/jres/` and called by `BaseJRE` internally. You
243
249
244
250
| Function | Purpose |
245
251
|----------|---------|
246
-
| `GetJREVersion(ctx, jreKey)` | Resolves version from `BP_JAVA_VERSION`, `JBP_CONFIG_<KEY>_JRE`, then manifest default |
247
-
| `DetectJREByEnv(jreKey)` | Returns `true` if `JBP_CONFIG_<KEY>_JRE` or `JBP_CONFIG_COMPONENTS` selects this JRE |
252
+
| `GetJREVersion(ctx, jreKey)` | Resolves version from `BP_JAVA_VERSION`, then the documented `JBP_CONFIG_<NAME>_JRE` or auto-generated `JBP_CONFIG_<KEY>` alias, then manifest default |
253
+
| `DetectJREByEnv(jreKey)` | Returns `true` if the documented `JBP_CONFIG_<NAME>_JRE` name or the auto-generated `JBP_CONFIG_<KEY>` alias selects this JRE |
0 commit comments