Skip to content

[FLINK] Add java-17 profile for Flink build and update project version in flink doc#10561

Merged
philo-he merged 2 commits intoapache:mainfrom
zjuwangg:flinkBuild
Aug 28, 2025
Merged

[FLINK] Add java-17 profile for Flink build and update project version in flink doc#10561
philo-he merged 2 commits intoapache:mainfrom
zjuwangg:flinkBuild

Conversation

@zjuwangg
Copy link
Copy Markdown
Contributor

@zjuwangg zjuwangg commented Aug 27, 2025

What changes are proposed in this pull request?

#10515 has made a great effort to decouple flink from parent gluten.

This PR adds a profile named java-17 to set both maven.compiler.source/target to 17 (defaults to 11) if users want to build the code with Java 17.

This PR update compiler version and update build jar version to match the master pom version change.

How was this patch tested?

NA

@github-actions github-actions bot added the FLINK label Aug 27, 2025
@philo-he philo-he self-requested a review August 27, 2025 14:42
@philo-he philo-he changed the title [FLINK]Update java compiler version to 11 and update flink doc to match version [FLINK] Update java compiler version to 11 and update flink doc to match version Aug 27, 2025
@philo-he
Copy link
Copy Markdown
Member

@zjuwangg, It makes sense to fix this since both Java 11 and 17 are supported. Setting maven.compiler.source/target to 17 would cause compatibility issues when building Gluten Flink with Java 11.

I think we can add a profile named java-17 to set both properties to 17 (defaults to 11) if users want to build the code with Java 17. This approach is different from setting the compiler properties to 11 while building with Java 17, as it enables Java 17 features. As you mentioned, velox4j is compiled with Java 11, but it should work when running on a Java 17 JVM due to Java's backward compatibility. Therefore, I assume we don't need to hardcode the compiler source and target properties to 11.

@zjuwangg
Copy link
Copy Markdown
Contributor Author

@zjuwangg, It makes sense to fix this since both Java 11 and 17 are supported. Setting maven.compiler.source/target to 17 would cause compatibility issues when building Gluten Flink with Java 11.

I think we can add a profile named java-17 to set both properties to 17 (defaults to 11) if users want to build the code with Java 17. This approach is different from setting the compiler properties to 11 while building with Java 17, as it enables Java 17 features. As you mentioned, velox4j is compiled with Java 11, but it should work when running on a Java 17 JVM due to Java's backward compatibility. Therefore, I assume we don't need to hardcode the compiler source and target properties to 11.

@philo-he
Really make sense to me. Will add a jdk17 compile profile soon.

@zjuwangg
Copy link
Copy Markdown
Contributor Author

@philo-he Just add a java-17 compile profile.

Copy link
Copy Markdown
Member

@philo-he philo-he left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Could you enable this profile in Flink CI job? I note Java 17 is used. Please also update the build section in Flink.md to indicate that users should add -Pjava-17 when building with Java 17.

@zjuwangg
Copy link
Copy Markdown
Contributor Author

Looks good. Could you enable this profile in Flink CI job? I note Java 17 is used. Please also update the build section in Flink.md to indicate that users should add -Pjava-17 when building with Java 17.

@philo-he

            <activation>
                <jdk>17</jdk>
            </activation>

Since we add jdk 17 activation option, java-17 profile will be auto selected when build with java 17. Tested passed in my owne box.

@zjuwangg
Copy link
Copy Markdown
Contributor Author

Could you enable this profile in Flink CI job?

I'll investigate on this and enable this profile in another separate PR.

@philo-he
Copy link
Copy Markdown
Member

@zjuwangg, I see. Then, there is no need to explicitly add the option in Flink CI. Thanks.

@philo-he philo-he changed the title [FLINK] Update java compiler version to 11 and update flink doc to match version [FLINK] Add java-17 profile for Flink build and update flink doc to match version Aug 28, 2025
@philo-he philo-he changed the title [FLINK] Add java-17 profile for Flink build and update flink doc to match version [FLINK] Add java-17 profile for Flink build and update project version in flink doc Aug 28, 2025
@philo-he philo-he merged commit edc650f into apache:main Aug 28, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants