← 返回首页
docs: rewrite IMPLEMENTING_JRES.md for BaseJRE pattern by stokpop · Pull Request #1339 · cloudfoundry/java-buildpack · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

docs: rewrite IMPLEMENTING_JRES.md for BaseJRE pattern#1339

Open
stokpop wants to merge 5 commits into
cloudfoundry:mainfrom
stokpop:docs/implementing-jres-basejre
Open

docs: rewrite IMPLEMENTING_JRES.md for BaseJRE pattern#1339
stokpop wants to merge 5 commits into
cloudfoundry:mainfrom
stokpop:docs/implementing-jres-basejre

Conversation

stokpop commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

What changed

  • Removed: manual boilerplate implementation guides (OpenJDK/Zulu/IBM step-by-step with full code listings), redundant "Best Practices" and "Common Patterns" sections (now handled by BaseJRE automatically)
  • Added: BaseJRE variation points table, 3-step implementation guide, lean examples for standard/exact-dir/error-hint patterns
  • Updated: Java 21 in all examples; memory calculator config now shows JBP_CONFIG_<JRE>_JRE as preferred (covers stack_threads, class_count, headroom) with a note that MEMORY_CALCULATOR_* env vars override but don't cover class_count
  • Kept lean: helper function reference table, memory calculator runtime output, JVMKill + heap dump volume service, troubleshooting section, summary, See Also cross-references

Related

Follows #1288 (BaseJRE refactor that this doc now describes)

Please review if complete or must be extended.

stokpop added 4 commits June 26, 2026 14:59
PR cloudfoundry#1288 refactored all standard JREs to embed BaseJRE (14 lines each), but the guide still showed the old 100+ line manual implementation with explicit Supply()/Finalize() boilerplate. Rewrite to document the actual pattern: newBaseJRE() + optional extraFinalizeOpts. Removes sections on manual memory calculator and JVMKill integration (now internal to BaseJRE). Adds variation-point table and examples for all three patterns (standard, exact-dir, error-hint).
…ooting Rebalances the IMPLEMENTING_JRES.md rewrite — adds back lean sections for: - Helper function reference table (GetJREVersion, WriteJavaOpts, etc.) - profile.d script output example - Memory calculator: runtime output and user customization env vars - JVMKill: purpose, heap dump / volume service binding - Troubleshooting: JAVA_HOME, memory calculator, version resolution
- Use Java 21 in version examples and profile.d output - Prefer JBP_CONFIG_<JRE>_JRE for memory calculator config (covers stack_threads, class_count, headroom) - Note MEMORY_CALCULATOR_* env vars take precedence but don't cover class_count - Add stack_threads/class_count/headroom descriptions

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Pull request overview

This PR rewrites docs/IMPLEMENTING_JRES.md to document the newer BaseJRE template-method pattern (introduced in #1288) and remove the older long-form “manual boilerplate” JRE provider implementation guidance.

Changes:

  • Replaces large per-provider implementation walkthroughs with a BaseJRE variation-points model and a short 3-step “how to add a JRE” guide.
  • Adds concise examples for standard prefix matching, exact-dir matching, and install-error hints.
  • Updates operational reference sections (memory calculator, JVMKill, troubleshooting) and refreshes examples to Java 21.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/IMPLEMENTING_JRES.md Outdated
### Detection

### Version Selection
`BaseJRE.Detect()` calls `DetectJREByEnv(jreKey)` which returns `true` when:
Comment thread docs/IMPLEMENTING_JRES.md Outdated Show resolved Hide resolved
Comment thread docs/IMPLEMENTING_JRES.md Outdated Show resolved Hide resolved
Comment thread docs/IMPLEMENTING_JRES.md Show resolved Hide resolved
Comment thread docs/IMPLEMENTING_JRES.md Show resolved Hide resolved
…NTING_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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread docs/IMPLEMENTING_JRES.md
```
-Xmx512M -Xms512M -XX:MaxMetaspaceSize=128M -Xss1M -XX:ReservedCodeCacheSize=32M
```
`stack_threads` — number of user threads (default: 200); affects `-Xss` heap budget.
Comment thread docs/IMPLEMENTING_JRES.md
```bash
cf env myapp | grep JBP_CONFIG_COMPONENTS
```
**Wrong Java version selected** — check resolution order: `BP_JAVA_VERSION` → `JBP_CONFIG_<KEY>_JRE` → manifest default. Enable debug: `cf set-env myapp BP_LOG_LEVEL DEBUG`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants

Footer

© 2026 GitHub, Inc.