Skip to content

Conversation

@gtchaboussie
Copy link

Changed: Migration to Java 21
(OFBIZ-13306)

Migration to Java 21

Thanks: Jacques for the warnings work and Nicolas.

cgaetan added 2 commits November 5, 2025 11:03
(OFBIZ-13306)

Migration to Java 21

Thanks: Jacques for the warnings work and Nicolas.
(OFBIZ-13306)

Migration to Java 21
Fix CheckStyle

Thanks: Jacques for the warnings work and Nicolas.
@gtchaboussie gtchaboussie changed the title Ofbiz 13306 OFBIZ-13306: JAVA 21 migration Nov 5, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

@JacquesLeRoux
Copy link
Contributor

I did not look at it yet, we got this:

Execution failed for task ':compileJava'.

error: invalid source release: 21

@ieugen
Copy link
Member

ieugen commented Nov 5, 2025

@gtchaboussie : thanks for the contribution.

I think you are also trying to increase the java source level - which might not be in scope right now.

The important part is that OFBiz can be built using JDK-21.
I don't believe it means we need to increase source level to 21 so only JDK-21+ can build OFBiz.
I think the source level/version can stay on 17 and have OFBiz build with JDK17 and JDK21

The build fails right now because the CI server uses only JDK-17.
It would be great to have OFBiz tested with multiple JDK versions at once (JDK build matrix) - but some other time.

Regarding source level increase, looking at https://docs.oracle.com/en/java/javase/21/language/java-language-changes-summary.html , the only language changes that are new from 17->21 are:

Record Patterns (JEP 440)

Pattern Matching for switch Expressions and Statements (JEP 441)

Not sure if those are enough to warrant a source level increase.
Should ask on ML.

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.

3 participants