ScriptEngine for Py not working

Hi! I’m a little new to Openhab and I was working on the Automation JSR223 scripts but it’s not working. I get this error: “2018-03-28 23:33:33.683 [INFO ] [rt.internal.loader.ScriptFileWatcher] - ScriptEngine for py not available”
I added
EXTRA_JAVA_OPTS=-Xbootclasspath/a:/home/jython2.7.0/jython.jar
-Dpython.home=/home/jython2.7.0
-Dpython.path=/etc/openhab2/lib/python
to the etc/default/openhab2 file.
Any idea what might fix it?
Thank you :slightly_smiling_face:

Where did you install your Jython libaries? It seems that /home/jython2.7.0. is an odd choice… Did you maybe install it in /home/pi/jython2.7.0 or /home/openhab/jython2.7.0?

Also if you have a multiline parameter string in your /etc/default/openhab config file, you need to add a backslash character to the end of all the lines except the last one. You could also have the config string on one line to work around this altogether. This is my EXTRA_JAVA_OPTS string :slight_smile:

EXTRA_JAVA_OPTS=-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0 -Xbootclasspath/a:/home/openhab/jython2.7.0/jython.jar -Dpython.home=/home/openhab/jython2.7.0 -Dpython.path=/etc/openhab2/lib/python

1 Like

Also, check out this post : Issue with JSR223 Jython scripting

1 Like

Thank you for replying! I removed openhab and reinstalled it and it ran correctly. I also noticed that when the laptop’s clock is different than the time that’s appearing on the openhab log the script doesn’t run correctly