Getting Scala as scripting language to work


I am trying to follow to install Scala as a scripting language.

Whatever I tried, I could not make openhab discover the Scala ScriptEngine. What did I wrong?


I think it is not possible at the moment. I tried, but it results in a ClassNotFoundException.

I believe - without really understanding the issue yet - it requires only a small change in the add-on. It must initialize the embeddedDefaults setting. This is described here:

A more detailed explanation for the issue can be found here:

Passing a custom classpath through OSGI is next to impossible because OSGI hacks all the classloaders and hooks in bundle resolution.

However, Scala can be installed as a bundle in OSGI and then the ScriptEngineManager needs to find the engines using OSGI resolution. There are some code snippets out there showing that this is quite easy.

But, the main paintpoint of using a scriptengine is rather making scripts work across multiple file (scoping, imports, etc.)…


Any news here?