Skip to content

Update minimum Java version references from Java 8 to Java 21#23

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1771955609-update-java-min-version
Open

Update minimum Java version references from Java 8 to Java 21#23
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1771955609-update-java-min-version

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Feb 24, 2026

Copy link
Copy Markdown

Description of what I changed

Updated the two remaining references to Java 8 as the minimum supported version to reflect Java 21:

  1. OpenmrsUtil.validateJavaVersion() — Replaced the old regex check (1\\.[0-7]\\.(.*)) with version-parsing logic that handles both the legacy 1.x.y scheme (pre-Java 9) and the modern x.y.z scheme (Java 9+). The method now throws an APIException if the detected major version is below 21.

  2. README.md — Updated the prerequisite text from "minimum version 8" to "minimum version 21".

Things for reviewers to look at closely

  • Version string parsing edge cases: The new parsing handles 1.x.y, x.y.z, x-ea, and bare x formats. Verify this covers all realistic java.version values your environments produce.
  • NumberFormatException risk: Unlike the old regex (which silently passed on unrecognized formats), Integer.parseInt will throw if java.version is unexpectedly malformed. This is a minor behavior change.
  • No new unit tests for the parsing logic itself. The existing JavaVersionTest only calls validateJavaVersion() on the running JVM (Java 21 in CI), so it will still pass — but it doesn't exercise the rejection path or edge-case version strings.

Issue I worked on

No JIRA issue — this is a documentation/config alignment change. The project's pom.xml already targets Java 21 (<javaCompilerVersion>21</javaCompilerVersion>) and CI uses amazoncorretto-21.

Checklist: I completed these to help reviewers :)

  • My IDE is configured to follow the code style of this project.
  • I have added tests to cover my changes. (If you refactored existing code that was well tested you do not have to add tests)
  • I ran mvn clean package right before creating this pull request and added all formatting changes to my commit.
  • All new and existing tests passed.
  • My pull request is based on the latest changes of the master branch.

Link to Devin run: https://app.devin.ai/sessions/9bfcbad15326404793a4355072703927
Requested by: @dillonvargo


Open with Devin

- Update validateJavaVersion() to correctly detect JVM versions below 21
  using both legacy (1.x) and modern (x.y.z) version schemes
- Update README.md to state Java 21 as minimum required JDK version

Co-Authored-By: unknown <>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

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.

1 participant