-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for running openHAB with Java 21 #1590
Comments
It seems that official Java 21 releases are delayed (see Temurin blog). Nevertheless I was able to use the Temurin 21-beta+34-202308082331 nightly build and got OH 4.1.0-SNAPSHOT running without issues so far after disabling the recently added Java compatibility check. It seems the recent Karaf 4.4.4 upgrade helped a lot because OH 4.0.3 does not start with Java 21:
We might also want to upgrade Netty to 4.1.99.Final or newer because it can crash the JVM, see: |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-4-1-release-discussion/152252/44 |
@wborn - it seems like the effort to upgrade from Java 17 to 21 is not that big? But I guess this would require a major new version of openHAB, i.e. 5.0 rather than 4.2? |
"Running with" and "Requiring" are two different things. "Requiring" would indeed be something for a major release, "Running with" is backward compatible and therefore nice to have even for a minor version. |
To allow compiling and running with Java21 as well, it looks like we need to upgrade a few more things,
I have also seen warnings about zip validation during compilation which could not be suppressed via |
@wborn I finally managed to create a distro zip compiled with Java 21 and running on Java 21 🥳 I will open the necessary PRs the next days. A few prerequisites are not yet merged, i.e. the SAT plugin and Karaf 4.4.5 patches. |
@kaikreuzer has released SAT 0.16.0 - thanks a lot! So here comes the first PR for Java 21: openhab/openhab-core#4161. The question to be decided is how we want to select the target version.
WDYT? And how should we deal with the CI? Shall we add J21 (matrix build)? |
After some discussion in openhab/openhab-core#4161 (comment), the new proposed approach is as follows:
All PRs have been adapted. @wborn FYI. |
* Support Java 17 and 21, default compilation to Java 17 class files * Add profile "j21" to compile to Java 21 class files * Bump ecj to 3.36.0 * Upgrade SAT to 0.16.0 Refs: openhab/openhab-distro#1590 Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
To update the status here as well: See my CI builds here: 🥳 What it still open, is to update the CI to a matrix build. I have not yet opened PRs, but it is there already on private repo above. |
Adding Java 21 to the GHA build matrix of the distro and webui repos would be nice as well. |
I will add it, thanks for testing the J21 builds. |
Just for reference: openhab/openhabian#1861 introduced Zulu JDK 21 installation to openHABian |
Refs openhab/openhab-distro#1590. Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
@wborn Do you think we are missing something in the scope if this ticket? OH can now run on Java 21. Maybe issues show up when more people are using is. Marketplace add-ons might run into the same problems with date encoding as we did. |
Many thanks for your efforts @holgerfriedrich! |
Today Java 21 will be launched. 🚀 This is a LTS release, so we should also support using it with openHAB.
We can use this issue to keep track of what still needs to be fixed or investigated (similar to #1316).
There's also a launch live stream: https://dev.java/community/java-21-launch/
TODO:
karaf
andkaraf.bat
The text was updated successfully, but these errors were encountered: