You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While getting the add-ons build to work with Java 17 in #12353, I noticed that the JavaScript Transformation add-on depends on the Nashorn JavaScript engine which has been removed from Java since Java 15.
Expected Behavior
The add-on works on Java 17 and later.
Current Behavior
It will try to get a "javascript" ScriptEngine but this will fail because it is no longer provided by the JVM.
Possible Solution
The easiest way would be to embed and use the nashorn dependency in the bundle.
It could also be rewritten to use GraalVM.
It might also be an idea to create an add-on (or core service) supporting transformations using any of the installed/available scripting engines.
Yes if that works out well it would provide a lot of functionality and reduce the number of add-ons we have to maintain/install. 🙂
I also did some testing with creating a Nashorn based JS scripting engine automation add-on for backwards compatibility on Java 17. The issues I ran into are probably fixed now with openhab/openhab-core#2787. But it could become very confusing if there are 2 JavaScript automation add-ons (and still Nashorn on Java 11).
While getting the add-ons build to work with Java 17 in #12353, I noticed that the JavaScript Transformation add-on depends on the Nashorn JavaScript engine which has been removed from Java since Java 15.
Expected Behavior
The add-on works on Java 17 and later.
Current Behavior
It will try to get a "javascript"
ScriptEngine
but this will fail because it is no longer provided by the JVM.Possible Solution
The easiest way would be to embed and use the nashorn dependency in the bundle.
It could also be rewritten to use GraalVM.
It might also be an idea to create an add-on (or core service) supporting transformations using any of the installed/available scripting engines.
Steps to Reproduce (for Bugs)
Your Environment
The text was updated successfully, but these errors were encountered: