Skip to content

Upgrade Java version requirements from Java 8 to Java 17/21#9

Open
dillonvargo wants to merge 1 commit into
masterfrom
devin/1769189402-upgrade-java-version
Open

Upgrade Java version requirements from Java 8 to Java 17/21#9
dillonvargo wants to merge 1 commit into
masterfrom
devin/1769189402-upgrade-java-version

Conversation

@dillonvargo

Copy link
Copy Markdown
Owner

Description of what I changed

This PR addresses Java version inconsistencies in the codebase by upgrading from Java 8 to Java 17/21:

  1. test-module/pom.xml: Updated javaCompilerVersion from 1.8 to 21 to match the root pom.xml
  2. OpenmrsUtil.validateJavaVersion(): Changed runtime validation to enforce Java 17 as the minimum version instead of Java 8. Added a new getMajorJavaVersion() helper method that handles both old-style version strings (1.8.0_xxx) and new-style (17.0.x, 21.0.x)
  3. README.md: Updated documentation to state Java 17 or 21 is required instead of Java 8

Issue I worked on

No JIRA ticket - this addresses Java version inconsistencies where the main project targets Java 21 but several components still referenced Java 8.

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.

Items for reviewer attention

  1. Version parsing logic: Please review getMajorJavaVersion() for edge cases - it handles old format (1.x), new format (17.0.x), and versions without dots (17-ea)
  2. No new unit tests: The existing JavaVersionTest passes but doesn't test the new helper method or edge cases. Consider whether additional test coverage is needed.

This PR was created with assistance from Devin on behalf of @dillonvargo

- Update test-module/pom.xml: Change javaCompilerVersion from 1.8 to 21
- Update OpenmrsUtil.validateJavaVersion(): Enforce Java 17 as minimum version
- Update README.md: Change Java requirement from version 8 to 17 or 21

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