I’m having trouble setting up jython with the JSR223 engine under OpenHAB 1.7.1 and Java 8. I have installed jython into /opt/jython from the installer package and symlinked it into /usr/share/openhab/lib. I’ve also added the -Dpython.home argument in /etc/default/openhab, but it still doesn’t get found.
My debug logs are showing the following relating to jsr223:
Yes, I also looked at that and added -cp /usr/share/openhab/lib/jython.jar to the JAVA_OPTIONS variable in /etc/default/openhab.
I had previously added some missing files to my jsr223 jar file in order to get the JS interpreter working, since the version in the Apt repo was broken. Perhaps I should just install from a different source? Where did you get the jar file from?
Thanks Steve, however I was more referring to the JSR223 .jar file. I saw something about the released version missing the OSGI-INF directory, which I think was the change I made. I was wondering if there is one that works ‘out of the box’?
That message is just a side-effect of not loading the Jython engine.
I don’t see anything obviously wrong. I am running 1.7.1 with a 1.8.0 JSR223 addon. As an experiment, you could try pointing your classpath directly to the jython.jar in /opt/jython. Given that you have Nashorn engine, that indicates that the JSR223 addon is loading correctly. It’s just not finding the Jython engine.
Take a look at…
I’m using the same technique in my startup script where I don’t use the -jar option and instead add the eclipse launcher to the classpath and run org.eclipse.equinox.launcher.Main.
w00t! I finally have it working (complete with test rule execution).
As you said I needed to add the eclipse launcher to the classpath and call org.eclipse.equinox.launcher.Main. I have an updated start script to this effect, which also allows you to specify a CLASSPATH variable in /etc/defaults/openhab. I will post this as part of a bug report over the weekend.