Upgrade Gradle wrapper from 7.6 to 8.5 for Java 21 support#572
Open
Tuguberk wants to merge 1 commit into
Open
Conversation
Gradle 7.6 supports Java up to version 19. Building Fast-DDS-Gen on systems where Java 21 is the default JDK fails with: BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65 Class file major version 65 corresponds to Java 21. Gradle 8.5 introduced official Java 21 support. This change upgrades the Gradle wrapper to 8.5, which supports Java 11 through 21. The build itself continues to compile sources to Java 8 bytecode (sourceCompatibility/targetCompatibility = 1.8 in build.gradle), so the produced fastddsgen.jar remains compatible with any Java 8+ runtime. Note: this change depends on eProsima/IDL-Parser#192, which replaces the deprecated Jar.classifier property (removed in Gradle 7) with archiveClassifier. Without that fix, the IDL-Parser submodule build fails under Gradle 7+. Signed-off-by: Tuguberk <akbulut.tugberk@gmail.com>
1e9fc10 to
1bfc5db
Compare
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.
Problem
Building Fast-DDS-Gen on systems where Java 21 is the default JDK fails immediately:
Class file major version 65 corresponds to Java 21. Gradle 7.6 (the current wrapper version) supports Java up to version 19 only.
Java 21 is an LTS release (September 2023) and is now the default JDK on many systems, including those installed via
brew install openjdk,apt install default-jdk, and the current Microsoft/Amazon/Eclipse Temurin distributions.Fix
Upgrade the Gradle wrapper to 8.5, which added official Java 21 support. The
build.gradlealready compiles to Java 8 bytecode (sourceCompatibility = targetCompatibility = 1.8), so the producedfastddsgen.jarremains compatible with any Java 8+ runtime.Dependency
This PR depends on eProsima/IDL-Parser#192, which replaces the deprecated
Jar.classifierproperty (removed in Gradle 7.0) witharchiveClassifier. Without that fix, the IDL-Parser submodule fails to configure under Gradle 7+:Testing
./gradlew assemblecompletes successfully with Java 21java -jar share/fastddsgen/java/fastddsgen.jar -version→fastddsgen version 4.2.0