-
-
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 17 #1316
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-and-future-jdk-versions-when/65572/43 |
The runtime seems to start with Java 17 🙂, but as expected DSL rules don't work:
It's probably due to this exception:
As a result "Rule DSL" also doesn't show as an option when adding rules via the UI. Because Nashorn was removed in Java 15, ECMAScript also doesn't show. It might still be possible to create an Automation add-on using nashorn-core for backwards compatibility and if GraalVM is not available for your architecture, see also: https://github.com/openjdk/nashorn . |
Regarding XStream: I'm not too confident we'll see a Java 17 implementation anytime soon (in contrast to XText where at least a roadmap exists). Maybe a change to Jakarta XML Binding 3 should be considered. There are already some addons using JAXB 2.x (while some others use XStream), so this could be unified, too. |
@wborn Seems like Azul has published an armhf version now, so I think you can mark that as completed. |
I haven't seen any XStream issues so far with my distro builds on Java 17. Only when running unit tests there were some:
It looks like the add-opens workaround most issues. So I've also added them to fix similar issues for the unit tests in openhab/openhab-core#2788. I also saw similar issues with Gson deserialization in tests. Upgrading to Gson 2.9.0 fixed the issues I ran into (Fix failing to serialize Collection or Map with inaccessible constructor), as well as the add-opens workaround. |
There are also some new annoying warnings we might want to look into. 🙄 You'll see this on startup:
Similar warnings are printed when SAT runs Spotbugs on Java 17. See: spotbugs/spotbugs#1579 |
@wborn XStream: That's good to hear. I just read the issue you linked above and it seems to be an issue. Probably we don't have |
I've created a JSScripting (Nashorn) add-on using the standalone Nashorn Engine which can be installed using the Marketplace. |
That (together with openhab/openhab-core#2883) and the next release of KARAF all issues seem to be resolved. |
Yes your transformation PRs look very promising! 👍 I plan on testing them soon. 🙂 Do you know if multiple JS scripting engines are also supported by the script transformation/profile in case users are still migrating between engines? |
Yes, it should, because they use different mime-types. The nashorn engine uses |
* Syncs distro customizations with Karaf 4.3.7 * Resolves app runbundles for the new dependencies For release notes, see: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311140&version=12351181 This fixes warnings when starting the runtime with Java 17 (openhab#1316). Signed-off-by: Wouter Born <[email protected]>
* Syncs distro customizations with Karaf 4.3.7 * Resolves app runbundles for the new dependencies For release notes, see: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311140&version=12351181 This fixes warnings when starting the runtime with Java 17 (openhab#1316). Signed-off-by: Wouter Born <[email protected]>
* Syncs distro customizations with Karaf 4.3.7 * Resolves app runbundles for the new dependencies For release notes, see: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311140&version=12351181 This fixes warnings when starting the runtime with Java 17 (#1316). Signed-off-by: Wouter Born <[email protected]>
This issue has been mentioned on openHAB Community. There might be relevant details there: |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/building-on-linux-vs-windows/136338/2 |
Regarding the Nashorn add-on: I think this should be added because otherwise a lot of code will need changing. |
Regarding Java 17, do you know if the automatic file reloading of the JS Scripting add-on is working? I am asking, because yesterday someone opened an issue on openhab-js and had problems with files not loading on Java 17: openhab/openhab-js#130. |
The reason is that Nashorn is missing on Java 17: The On Java 11 this works, because Nashorn is available. On Java 17 Nashorn is not available, so the script type |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/send-command-to-serial-port-and-receive-a-answer/138672/64 |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-4-0-snapshot-discussion/142322/22 |
Everything is done now! 🥳 |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
Java 17 was released on September 14th. This is a LTS release, so we should also support using it with openHAB.
This issue keeps track of what still needs to be fixed or investigated:
with Add a generic script transformation openhab-core#2883
and Introduce a profile for the generic SCRIPT transformation openhab-core#3292 and Allow inline scripts in SCRIPT transformation openhab-core#3249
The text was updated successfully, but these errors were encountered: