Skip to content

Update Java version requirement from 8 to 21#29

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1773768740-java21-version-update
Open

Update Java version requirement from 8 to 21#29
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1773768740-java21-version-update

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Mar 17, 2026

Copy link
Copy Markdown

Description of what I changed

Updated all remaining Java 8 references to Java 21 across three locations:

  • test-module/pom.xml: Changed <javaCompilerVersion> from 1.8 to 21.
  • README.md: Updated the documented minimum JDK version from 8 to 21.
  • OpenmrsUtil.java (validateJavaVersion()): Replaced the old regex-based check ("1\\.[0-7]\\.(.*)") with Runtime.version().feature() < 21. The old regex only rejected pre-Java-9 version strings (1.0–1.7) and could never catch Java 9–20. The new check uses the Runtime.Version API (available since Java 9) to properly reject any JVM below 21. Javadoc and error message updated accordingly.

Issue I worked on

No JIRA issue — this is a consistency fix to align stale Java 8 references with the project's actual Java 21 requirement.

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.

Things for reviewers to verify

  • Runtime.version().feature(): Confirm this is the preferred API for retrieving the major version on Java 21. (It is — Runtime.Version.feature() returns the feature-release counter, i.e. 21 for Java 21.)
  • Existing tests: Check whether any tests for validateJavaVersion() exist and need updating to reflect the new threshold.

Link to Devin session: https://app.devin.ai/sessions/7725de67874e4936ae707c4d76294861
Requested by: @dillonvargo


Open with Devin

- test-module/pom.xml: Change javaCompilerVersion from 1.8 to 21
- README.md: Update minimum Java JDK version from 8 to 21
- OpenmrsUtil.java: Rewrite validateJavaVersion() to use
  Runtime.version().feature() < 21 instead of regex-based check
  for old-style 1.x version strings

Co-Authored-By: Dillon Vargo <dillonvargo@gmail.com>
@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 1 additional finding.

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