Error message "ScriptEngine for language 'application/javascript' could not be found for identifier"

Just in case you come across this error message in your log file:

ScriptEngine for language 'application/javascript' could not be found for identifier: 

then you probably updated your Java engine to version 17 and still have JSR223 scripts.
In this case either convert your scripts to ECMAScript-2021 or revert back to Java version 11.

1 Like

Note there are at least two issues I know of with running OH on Java 17 beyond this. So it is not recommended. Stick with JDK 11 and don’t try to upgrade until Java moves to support a later LTS version of Java.

Note that ECMAScript 5.1 will no longer be supported at that point so it makes sense to slowly start the conversion to ECMAScript 2021 now so you are not under the gun when the time comes.

I have started testing Java 17 but did not come across any problems yet.
What are the two issues you know of? I checked the forum but could not find any post.

Given that Java 11 is the one and only version of Java that openHAB officially supports, you wouldn’t find anything on the forum short of “don’t do that, use Java 11” when it doesn’t work.

You need to look on Github where the developers are working to find and fix any problems before the move. If you want to contribute to this effort, that’s where you need to start also since and changes required will involve changes to code, build scripts, versions of libraries, etc.

1 Like

There’s now also a Marketplace add-on which you can use to get the old Nashorn engine back on Java 17. :slight_smile:

1 Like

I didn’t think that was possible. Very nice! Thanks!