I have added the same to sh.bat as my Openhab runs as a service.
I can add as an windows enviroment variable instead.
I have tried it before but there was no difference but it was before I have changed the loacation of Jython standalone file. Sorry I have tried many variation and that’s why I ask some help. So I welcome any suggestion as I think I have a tiny bug somwhere. OH was restared after each change. If you suggest I can do it more time.
log files of openahb.log and ruleengine.log: ruleengine_201911061945.log (36.4 KB)
It does not load any rules from automation folders just when I copy it there while Openhab runs. Result is the same:
2019-11-03 19:46:48.702 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/C:/openhab2/conf/automation/jsr223/python/personal/owm_daily_forecast.py
2019-11-03 19:46:48.983 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script ‘file:/C:/openhab2/conf/automation/jsr223/python/personal/owm_daily_forecast.py’: ImportError: No module named core in at line number 104
So I have installed 2.5R1. Than I set up according to helper instructions. I have checked setnev.bat and config is ok so I suppose to use this in start.bat: 1. set EXTRA_JAVA_OPTS=-Xbootclasspath/a:C:\openhab2\conf\automation\jython\jython-standalone-2.7.0.jar -Dpython.home=C:\openhab2\conf\automation\jython -Dpython.path=C:\openhab2\conf\automation\lib\python
however it does not work, so I used this workaround: [Windows] All OH logs stop when Jython is in the classpath
but than when any Phyton or Jythone rules are starting none of the libraries are loaded. I get such error messages: Error during evaluation of script ‘file:/C:/openHAB2/conf/automation/jsr223/python/personal/hello_world.py’: ImportError: No module named core in at line number 5
line 5:
I forget… is that top section user or system? Set it in the system variables so that your service can use them. Or set the runAs for the service as an actual account, then log in as that user and set their user variables. Much easier to do this in the start.bat. And even easier to use the bundle!
Openhab runs as a service on my server.
Same result: 2019-12-21 20:21:56.358 [WARN ] [jsr223.jython.TEST ] - sys.path = [‘C:\openhab2\runtime\lib\boot\Lib’, ‘C:\openhab2\runtime\lib\boot\jython-standalone-2.7.0.jar\Lib’, ‘classpath’, ‘pyclasspath/’]
Yes, that looks to be working now. I also shifted over to a Windows environment. Setting up the EXTRA_JAVA_OPTS in start.bat worked fine. Remember the bug with scripts not starting in Windows (linked somewhere above). Powershell is also terrible for tailing!
I would think that the solution is very simple. I set everything back (deleted jython standalone from lib/boot folder, deleted all extra_java_opts lines from start.bat, setnev.bat etc) to default and I have changed only one thing:
Also there is one thing what is not 100% clear for me. Whitch start.bat we have to modify? There is one in main openhab2 folder and another one in \openhab2\runtime\bin folder. It should be also specified.
The instructions in the helper library documentation works well for setting up openHAB in Windows when it is not being setup as a service. It is a better solution than modifying environment variables.
I will update the helper library documentation with this information. However, these steps are no longer needed if you use the test Jython bundle or after it is merged.
The helper library documentation is referring to $OPENHAB_HOME\start.bat.
In all of the testing I have done today in Windows, I have not seen an issue with the logs not working. I’ve been using S1778 and watching the log in Powershell with…
Thanks! I was not clear from the description as well that this is manual startup or manual config. I mean windows setup is a manual config or at least when I started to use OH it was. After that automated update was avaiable sometime but it never worked for me. Anyway I have modified my wrapper.con, added these 3 lines, deleted enviroment variables, cleared catch and tmp folders and restarted everything all over again. It works. So I would suggest to clarify these differences a little bit more detailed in the helper instructions than it will be perfect.