fix: improve Java 25+ Gradle compatibility check in Makefile#394
Merged
Conversation
More robust fix for #392: - Always clear gradle-8.* caches when Java 25+ is detected - Update all Gradle-dependent targets to use check-java-gradle - Include clean, deb, test-unit, test-gradle-*, and sbom-java targets - Better error messages when system gradle is not available - Only attempt wrapper update if properties show Gradle < 9 The fix now handles the case where `make clean` is run first (which was failing in the original report). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Update check-java-gradle to extract both major and minor version numbers - Properly compare versions to detect 9.0.x as insufficient for Java 25+ - Clear both gradle-8.* and gradle-9.0* cache directories - Use Gradle 9.1.0 (first version with full Java 25 support) - Update docs with official Gradle compatibility matrix Fixes #392 Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
On Windows CI, Make uses Git Bash, so ifeq($(OS),Windows_NT) branches that use cmd.exe syntax fail. This change: - Removes the ifeq/else/endif and uses bash syntax throughout - Adds 2>/dev/null to numeric comparisons for portability - Adds || true to optional cleanup commands Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The old gradle command (8.x) cannot run on Java 25+ due to class file version 69. Instead of running `gradle wrapper --gradle-version=9.1.0`, we directly update the distributionUrl in gradle-wrapper.properties using sed. The wrapper script will then download the correct version. This fixes the case where users have an old system gradle installed (e.g., via sdkman) that crashes when running on Java 25+. Fixes #392 Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #392 (reopened after initial fix)
This PR fixes the Java 25+ Gradle compatibility issue by directly modifying
gradle-wrapper.propertiesinstead of running the gradle command.The Problem:
Users with Java 25+ and an older system Gradle (8.x from sdkman, Homebrew, etc.) cannot build because:
gradle wrapper --gradle-version=9.1.0fails because the old gradle crashesThe Solution:
sedto updategradle-wrapper.propertiesinstead of runninggradle wrappergradle-8.*andgradle-9.0*cache directoriesOfficial Gradle Compatibility:
Test plan
make clean && makepasses on macOSGenerated with Devin