Hello All,
I recently worked on a Jira issue (Upgrade java version to 21):
https://issues.apache.org/jira/browse/OFBIZ-13306
First of all, I provided support for Java 21 in the OFBiz trunk code. And
then after reading the comment on Jira, I concluded to provide support for
both Java17 and Java21 in the ofbiz trunk.
More details below:
Since Release24.09 still runs on Java 17, we've rolled trunk's compile
target back to Java 17 while keeping it tested on Java 21 too.
Summary:
1) build.gradle and gradle.yml now target Java 17 again (bytecode, javadoc,
CI). Please refer how I have used metrix support in gradle.yml file.
2) CI now runs a JDK matrix (17 and 21) on every push/PR, skipping 21 for
release* branches.
3) Reverted Java 19+ only calls (Locale.of, Thread.threadId) back to their
pre-19 equivalents across 16 files, since JDK 17 doesn't have them.
4) Confirmed those older calls are only "deprecated," not "removed," so
they're safe on both JDK versions.
5) Cleaned up all resulting compiler warnings with narrowly-scoped
@SuppressWarnings("deprecation").
6) Also caught and reverted two committed secret values in
security.properties back to blank.
7) Ran the full unit test suite (423 tests) on both JDK 17 and JDK 21 — 0
warnings, 0 failures on both.
8) I have built and run the code on my laptop. Here is the console output.
https://issues.apache.org/jira/secure/attachment/13083276/console-output-java17.txt
https://issues.apache.org/jira/secure/attachment/13083277/console-output-java21.txt
Here is the PR of my work:
https://github.com/apache/ofbiz-framework/pull/1460
Now I am all set to start using ofbiz trunk code on Java21 in my laptop and
others can also do the same.
Please let me know if you may require further assistance on this work.
Thanks & Regards,
Ashish Vijaywargiya
https://www.linkedin.com/in/ashishvijaywargiya/