Guys,
I am trying to follow https://github.com/openhab/openhab/wiki/Jsr223-Script-Engine to install Scala as a scripting language.
Whatever I tried, I could not make openhab discover the Scala ScriptEngine. What did I wrong?
dero
Guys,
I am trying to follow https://github.com/openhab/openhab/wiki/Jsr223-Script-Engine to install Scala as a scripting language.
Whatever I tried, I could not make openhab discover the Scala ScriptEngine. What did I wrong?
dero
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:
http://www.scala-sbt.org/0.13/docs/Faq.html#How+do+I+use+the+Scala+interpreter+in+my+code%3F
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.)…
Dero
Any news here?