Issue of the topic: I have a rule, that used to work fine, but at “some” point it started to fail. The only thing that rule does is executing the Bash script. When I run this script manually via command line it runs without any errors, but when through executeCommandLine within the rule it ends with a Java exception:
2024-02-08 09:01:00.294 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Error occurred when executing commandLine ‘[/home/openhabian/script.bash]’
java.io.IOException: Cannot run program “/home/openhabian/script.bash”: error=0, Failed to exec spawn helper: pid: 2102616, signal: 11
Below is the rule code:
rule scriptRefresh
when
Time cron "0 0/1 * * * ? *"
then
var ScriptResponse = executeCommandLine("/home/openhabian/script.bash")
logInfo("test", "Results " + ScriptResponse)
end
Thanks for quick response. I’m not that advance in this stuff, what does it mean “add to openhab launch command line”? Should I modify some OpenHab source files? If yes, where to find them?
I have googled in the meantime and added your solution in the file /etc/default/openhad, where also I could find EXTRA_JAVA_OPTS. Now it works! Thank you very much.
Hey thanks everyone in this thread!!! I have a script that I execute with openhab to change the volume on my media center computer (separate from my openhab computer) to an item value and somehow had not noticed that sense java was upgraded to version 14 on my openhab machine that it was failing with a similar error to WojtusJ. I edited /etc/default/openhab and added the above to the file so that the line now looks like this: