I followed the procedure outlined in http://docs.openhab.org/installation/windows.html#file-locations for OpenHAB 2.1.0. When I try to install the OpenHAB2 service with the command
net start "openHAB2"
In Windows PowerShell with Administrator privileges, after a few dozen seconds the message comes out
"The OpenHAB2 service could not be started.
System error
System error 1067. "
I add that I use Windows 10 Home with
"Java version “1.8.0_131"
Java ™ SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot ™ 64-Bit Server VM (build 25.131-b11, mixed mode)”
@OpenHABVirginia It is possible to run OpenHAB2 with JRE (=Java Runtime Environment) or JDK (=Java Development Kit). It seems that you have installed JRE.
I don’t exactly know if JDK is a prerequisite for “Starting OH2 as a service”. Please read very carefully this manual. Maybe you should install JDK first.
I haven’t tried setting JAVA_HOME to the JRE path but I believe that this should be enough and the windows service should work with only JRE installed.
I have installed JDK (and JRE) in my system and I made the docs entry using that… maybe I should update it
not much… (actually… it looks good… I have the same entries in my system where the service works)
strange… I can’t replicate this issue
how about setting a higher log level in openHAB2-wrapper.conf
During startup (or installation?) of the OH2-service, the following file was modified: (don’t know why!! ??)
.\userdata\etc\ org.ops4j.pax.web.cfg (and some others!)
#
# http port.
# This is currently also in the setenv
org.osgi.service.http.port = 8080
#
# https port, default is 8443.
# This is currently also in the setenv
#
org.osgi.service.http.port.secure = 8443
both lines were commented with a # at the beginning
I don’t think that this file (C:\openHAB2\userdata\etc\org.ops4j.pax.web.cfg) was modified.
I checked in my system and it is the same (http & https ports commented out… using defaults)
Whatever is configured there, ends up in C:\openHAB2\userdata\config\org\ops4j\pax\web.config
web.config pulls also C:\openHAB2\runtime\etc\jetty.xml where the ports are set (hmmm… only https is defined in there… not http)
Anyway… we have the wrapper.java.additional.16=-Dorg.osgi.service.http.port=8080 in the wrapper.conf… that should work.
I am testing more the windows service installation steps with various combinations… so far I haven’t been able to reproduce the issue…
I was always worried about this service wrapper since it does not use/take into account the scripts in runtime\bin…
That’s why the wrapper.conf is so complicated
#
# http port.
# This is currently also in the setenv
# org.osgi.service.http.port = 8080
#
# https port, default is 8443.
# This is currently also in the setenv
#
# org.osgi.service.http.port.secure = 8443
Then I installed “openHAB 2 Service” again. Indeed, the org.ops4j.pax.web.cfg was not modified!
Then I checked the openHAB2-service.bat created during wrapper-installation:
set APP_BASE=C:\Openhab2-940\userdata
set APP_ETC=C:\Openha~2\userdata\etc
In my very first attempt, I corrected:
from
set APP_ETC=C:\Openha~2\userdata\etc
to
set APP_ETC=C:\Openhab2-940\userdata\etc
because I thought this must be wrong, but it wasn’t, as I now know!