Need some help, what am I doing wrong?

  • Platform information:
    HP Deskpro 600 mini

    • Hardware:
      Intel I 5
    • OS:
      Windows 10 64 bit
    • Java Runtime Environment:
      Zulu-8
    • openHAB version:
      25.0 Snapshot build#1744
      **Issue of the topic:
      I am having config issues when trying to install OH as a service on my windows 10. I think that I have followed the written instructions to the best of my knowledge. I am sure I properly edits the wrapper config file.
  • Please post configurations (if applicable):
    C:\WINDOWS\system32>C:\openHAB\userdata\bin\openHAB2-service.bat install
    wrapper | Unable to set working directory to: %OPENHAB_HOME%\userdata (The system cannot find the path specified. (0x3))

    • Items configuration related to the issue
      #*******************************************************

openHAB2-wrapper.conf for Windows Service Installation

#*******************************************************

openHAB installation dir (Adapt this first setting to your system)

set.default.JAVA_HOME=C:\Program Files\Zulu\zulu-8

Wrapper Properties

set.default.OPENHAB_CONF=%OPENHAB_HOME%\conf
set.default.OPENHAB_RUNTIME=%OPENHAB_HOME%\runtime
set.default.OPENHAB_USERDATA=%OPENHAB_HOME%\userdata
set.default.OPENHAB_LOGDIR=%OPENHAB_USERDATA%\logs
set.default.KARAF_HOME=%OPENHAB_RUNTIME%
set.default.KARAF_BASE=%OPENHAB_USERDATA%
set.default.KARAF_DATA=%OPENHAB_USERDATA%
set.default.KARAF_ETC=%OPENHAB_USERDATA%\etc
set.default.PATH=%PATH%;%KARAF_BASE%\lib;%KARAF_HOME%\l

  • Sitemap configuration related to the issue
  • Rules code related to the issue
  • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

A typo? It probably should be

%OPENHAB_HOME\%userdata

Windows uses backslashes as directory delimiters and the slash was in the wrong place.

Which written directions? There areofficial documentation, community threads here, and random videos.

These instructions are from the official documentation page. The only thing I added was when i downgraded HA to 0.100.3

Not saying that it could not be a typo, just that I copied the whole config file from the official guide nd only changed the first line as instructed.

1 Like

Actually I was wrong in my guess. One of the first lines copied is

# openHAB installation dir (Adapt this first setting to your system)
set.default.OPENHAB_HOME=C:\openHAB2

Does the C:\openHAB2 exist?

1 Like

My location is called openHAB only. I thought I need replace that first line with this"set.default.JAVA_HOME=C:\Program Files\Zulu\zulu-8"?

Did you change the set.default line in tour configuration file to point to that folder?

No, according to the documentation that is set as a system variable, not in the configuration file.

Hey Bruce , thanks for the reply. so I am fully lost.

Is this the first line line in the config file:

openHAB installation dir (Adapt this first setting to your system)

set.default.OPENHAB_HOME=C:\openHAB2

I have changed this file to say
set.default.JAVA_HOME=C:\openHAB2
Then changed it back to say OPENHAB-HOME=C:\OpenHAB2

this is my actual address when my install currently resides: C:\OpenHAB2

but this is the outcome that I am getting as my output

Microsoft Windows [Version 10.0.18362.418]
© 2019 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>C:\OpenHAB2\userdata\bin\openHAB2-service.bat install

C:\WINDOWS\system32>C:\OpenHAB2\userdata\bin\openHAB2-service.bat install

C:\WINDOWS\system32>C:\OpenHAB2
‘C:\OpenHAB2’ is not recognized as an internal or external command,
operable program or batch file.

C:\WINDOWS\system32>C:\OpenHAB2
‘C:\OpenHAB2’ is not recognized as an internal or external command,
operable program or batch file.

C:\WINDOWS\system32>

I don’t get what I am doing wrong here. Can you or anyone else show me, I have read the instruction over 8 times and I am following it to the letter yet the outcome has been the same.

Actually I have never installed openHAB in Windows. When I started I setup a VirtualBox Linux VM on my Windows box.
Perhaps I can find some time to try.

??? These just seem like random changes.

JAVA_HOME is where your java install lives. Might be something like C:\Program Files\Java

OPENHAB_HOME is not the same as OPENHAB-HOME

It’s been a while since I installed OH on Windows. I recall just unzipping to C:\openhab2 and running start.bat. I did need to change the system variable for java home.

hey Ross , my bad for the confusion,. You are correct that OPENHAB_HOME is not the same as OPENHAB-HOME. The later was an error cause by frustration, I did write it out properly. That said you are also correct in the statement and notion that all you need to do is run the start.bat file for your initial run. That said I wanted to have OpenHAB2 run as a service on my computer. I was for that reason that I was taking this path. I would say It this point I will Bruce’s advice create a VM and install it there.

Make sure you set the VM up for bridged network so it gets an up address on your production network.

My point about running start.bat was more about “does that work for you?”. It’s probably easier to fix that than to fix a service creation.

1 Like

Hey guys I’m back but with a different issue related to install.
I have a vm running ubuntu installed on my windows 10 box. I am trying to install Openhabian. I got java setup and tried to run the install commands for Openhabian. this was the outcome :

sudo git clone https://github.com/openhab/openhabian.git /opt/openhabian

sudo: git: command not found

sudo git clone https://github.com/openhab/openhabian.git /opt/openhabian

sudo: git: command not found.

I have painstakingly gone through and check that everything is written out correctly an I am not understanding what the issue could be.
Can you guys help out?

Hi try to use https://chocolatey.org/packages/openhab

it will setup pathes also, at least it did so for me
use run as admin

you have two simple steps

  1. isntall choco (just type this in admin CMD)

@“%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe” -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command “iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))” && SET “PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin”

  1. install OH

choco install openhab

you can also install zulu if you need before

choco install zulu
choco install zulu8
choco install zulu11

i am also on Linux, but without the windows release i would never got to know OH
but if you want to get serious i will recommend leaving windows before you get to involved, i can tell you that migration will be a pain in the future good luck

You missed the command before that to install git

sudo apt-get install git

Thanks Bruce. jumped the gun a bit there. That being said I have run into another issue since addressing the first issue

eed to get 276 kB of archives.
After this operation, 930 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libonig4 amd64 6.7.0-1 [119 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libjq1 amd64 1.5+dfsg-2 [111 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 jq amd64 1.5+dfsg-2 [45.6 kB]
Fetched 276 kB in 1s (273 kB/s)
Selecting previously unselected package libonig4:amd64.
(Reading database ... 165116 files and directories currently installed.)
Preparing to unpack .../libonig4_6.7.0-1_amd64.deb ...
Unpacking libonig4:amd64 (6.7.0-1) ...
Selecting previously unselected package libjq1:amd64.
Preparing to unpack .../libjq1_1.5+dfsg-2_amd64.deb ...
Unpacking libjq1:amd64 (1.5+dfsg-2) ...
Selecting previously unselected package jq.
Preparing to unpack .../jq_1.5+dfsg-2_amd64.deb ...
Unpacking jq (1.5+dfsg-2) ...
Setting up libonig4:amd64 (6.7.0-1) ...
Setting up libjq1:amd64 (1.5+dfsg-2) ...
Setting up jq (1.5+dfsg-2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
/opt/openhabian/functions/java-jre.bash: line 181: curl: command not found
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)

$ systemctl start openhab2.service 
Failed to start openhab2.service: Unit openhab2.service not found.
FAILED

I am sure I missed a step just not sure where. Linux is new to me.

I have considered running choco, but I want to learn a few things about my system, also does choco not strip the install down to the barebones?

You need to be running Java 8 not Java 11.
What instructions are you following?

hey Bruce , so I am not sure how it got to be version 11. Here is the one i downloaded

zulu8.42.0.23-ca-jdk8.0.232-linux_x64.tar.gz

maybe it changed when I ran it through.How to I reverse it? Is there some instructions guide I can follow?

below is the instructions that I am current following.