OpenHAB 2 installation on Windows 10

(OpenHABVirginia) #1

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)”

Thank you very much

0 Likes

(Angelos) #2

what is the output of:

echo %JAVA_HOME%

there maybe an issue with the wrapper.conf that needs to be fixed. I will check this myself later today.

0 Likes

(OpenHABVirginia) #3

I have not seen any echoes

0 Likes

(Angelos) #4

then your installation does not meet the http://docs.openhab.org/installation/windows.html#prerequisites
(you need to set the %JAVA_HOME% system environment variable… with that set, the output of echo %JAVA_HOME% will be…)

C:\WINDOWS\system32>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_131
0 Likes

(OpenHABVirginia) #5

Java is not installed in …\Java\jdk… as you can see here

Before I run the above commands, I reinstalled Oracle Java using the link in page http://docs.openhab.org/installation/index.html

1 Like

(Tobi R) #6

i have the same problem. system error 1067

echo %JAVA_HOME% is ok
regedit ok

0 Likes

(Angelos) #7

Are you using a System Environment Variable for the JAVA_HOME or a User Variable?

0 Likes

(OpenHABVirginia) #8

System variable

0 Likes

(OpenHABVirginia) #9

Running start.bat Karaf writes

0 Likes

(Alex) #10

@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.

You can download it here: Oracle JDK Downloads

Don’t forget to switch
JAVA_HOME to C:\Program Files\Java\jdk1.8.0_131 or C:\Program Files (x86)\Java\jdk1.8.0_131
after installation…

Then follow all steps in the manual.

0 Likes

(Angelos) #11

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 :slight_smile:

0 Likes

(Angelos) #12

Try the following please:

set the JAVA_HOME System Environment Variable to:

C:\Progra~2\Java\jre1.8.0_131

and try again… I have an idea why this is happening… :slight_smile:

0 Likes

(Alex) #13

@Dim I also tried to install “OpenHab as a Service”. I followed exactly the manual

Everything seems to be OK, but OH2-Website is not running:


http://127.0.0.1:8080/start/index

HTTP ERROR: 404

Problem accessing /start/index. Reason:

Not Found

Powered by Jetty://


When I start OH2 with start.bat, everything is OK.

0 Likes

(Angelos) #14

hmmm…
anything useful in C:\openHAB2\logs\wrapper.log ?

0 Likes

(Alex) #15

@Dim

STATUS | wrapper  | 2017/07/06 10:39:45 | --> Wrapper Started as Service
STATUS | wrapper  | 2017/07/06 10:39:45 | Launching a JVM...
INFO   | jvm 1    | 2017/07/06 10:39:46 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO   | jvm 1    | 2017/07/06 10:39:46 |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
INFO   | jvm 1    | 2017/07/06 10:39:46 | 
INFO   | jvm 1    | 2017/07/06 10:39:48 | Jul 06, 2017 10:39:47 AM org.apache.karaf.main.lock.SimpleFileLock lock
INFO   | jvm 1    | 2017/07/06 10:39:48 | INFORMATION: Trying to lock C:\Openhab2-940\userdata\tmp\lock
INFO   | jvm 1    | 2017/07/06 10:39:48 | Jul 06, 2017 10:39:47 AM org.apache.karaf.main.lock.SimpleFileLock lock
INFO   | jvm 1    | 2017/07/06 10:39:48 | INFORMATION: Lock acquired
INFO   | jvm 1    | 2017/07/06 10:39:48 | Jul 06, 2017 10:39:47 AM org.apache.karaf.main.Main$KarafLockCallback lockAquired
INFO   | jvm 1    | 2017/07/06 10:39:48 | INFORMATION: Lock acquired. Setting startlevel to 100

That’s all…

0 Likes

(Angelos) #16

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

wrapper.logfile.loglevel=DEBUG

and maybe anything in openhab.log ?

0 Likes

(Alex) #17

@dim I found the errors:

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 removed them, and now it’s running!

0 Likes

(Angelos) #18

I will check this also on my side…
So far, I haven’t seen the wrapper do crazy stuff… you never know :slight_smile:

0 Likes

(Angelos) #19

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 :frowning:

0 Likes

(Alex) #20

@Dim Please stop your investigations!

I removed “openHAB 2 Service”.

I switched in org.ops4j.pax.web.cfg back to:

#
# 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!

Now, everything is running!

Thanks for your support! :slightly_smiling_face:

1 Like