Skip to content

Upgrade Java version references from Java 8/17 to Java 21#17

Open
dillonvargo wants to merge 1 commit into
masterfrom
devin/1771538967-upgrade-java-21-refs
Open

Upgrade Java version references from Java 8/17 to Java 21#17
dillonvargo wants to merge 1 commit into
masterfrom
devin/1771538967-upgrade-java-21-refs

Conversation

@dillonvargo

Copy link
Copy Markdown
Owner

Description of what I changed

Updates all outdated Java version references to reflect that Java 21 is now the minimum required version (matching the existing javaCompilerVersion property of 21 in pom.xml).

Three files changed:

  1. api/src/main/java/org/openmrs/util/OpenmrsUtil.java — Rewrote validateJavaVersion() to require Java 21 minimum. The old implementation used a regex (1\\.[0-7]\\.(.*)) that only rejected Java 7 and below under the legacy 1.x versioning scheme. The new implementation parses the major version integer from java.version, handling both legacy 1.x and modern X.y.z formats.

  2. README.md — Updated minimum Java JDK version from 8 to 21.

  3. pom.xml — Removed the java17 Maven profile. It provided the same mockito/bytebuddy dependency overrides as the java21 and java24 profiles and is no longer needed now that Java 21 is the minimum. The java21 and java24 profiles are retained.

Not changed: startup.sh — Its debug port logic checks JAVA_VERSION > 8, which remains correct for Java 21+.

⚠️ Items for reviewer attention

  • Version string edge cases in validateJavaVersion(): The new parsing splits on '.' to extract the major version. Version strings without a dot that contain non-numeric suffixes (e.g., 21-ea, 21+35) would cause a NumberFormatException from Integer.parseInt. Consider whether a dash/plus-aware split is needed, or whether this is acceptable since early-access JDKs aren't a supported runtime target.
  • No unit tests added for the updated validateJavaVersion() logic. Existing tests (if any) for this method would now be stale.
  • Java 17 profile removal: Confirm no active CI jobs or contributor workflows depend on building with JDK 17.

Issue I worked on

see https://issues.openmrs.org/browse/TRUNK-

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/b4f61cbb1e71411abb6ab1346f3aac41
Requested by: @dillonvargo

- Update validateJavaVersion() to require Java 21 minimum
- Update README.md to reference Java 21 as minimum version
- Remove obsolete Java 17 Maven profile (Java 21 is now minimum)

Co-Authored-By: Dillon Vargo <dillonvargo@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown

🤖 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

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