OPENHAB2 service is unable to start

  • Platform information:
    • Hardware: Raspberry Pi 3 * OS: Raspbian Stretch
    • Java Runtime Environment: Arm 32bit JDK on Linux (for Armv8/v7/v6 Hard Float ABI)
  • openHAB version: 2.4.0 stable
  • Issue of the topic: unable to start openHab service.

after installing (*steps done are below) openHab, everthing was ok without any error, we start the openHab service, it show Ok, we check for the status, it shows:

pi@RasPi:~ $ **sudo /etc/init.d/openhab2 status**
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sat 2019-01-05 09:57:35 GMT; 4s ago
  Process: 3098 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE)
  Process: 3082 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=1/FAILURE)
 Main PID: 3082 (code=exited, status=1/FAILURE)

Jan 05 09:57:35 RasPi systemd[1]: openhab2.service: Unit entered failed state.
Jan 05 09:57:35 RasPi systemd[1]: openhab2.service: Failed with result 'exit-code'.


we continue to check for the log however the log file wasn’t in the defined location.

pi@RasPi:~ $ **sudo openhab-cli showlogs**

tail: cannot open '/var/log/openhab2/*.log' for reading: No such file or directory
tail: no files remaining
pi@RasPi:~ $


when we use the command to Start again, it shows:

pi@RasPi:~ $ **sudo openhab-cli start**

A systemd service configuration exists...
Use 'sudo /bin/systemctl start openhab2.service' to start an openHAB service
Launching an instance in this terminal..
Launching the openHAB runtime...
**java command not found**


so the java was installed before
I also check the line:

pi@RasPi:~ $ java -version
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (Zulu (build 1.8.0_192-b134)
OpenJDK Client VM (Zulu (build 25.192-b134, mixed mode, Evaluation)
pi@RasPi:~ $


could you please help to on this issue :-s

  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • 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:

is there anybody help ???

can anyone help me??

Did you install manually or use apt-get/openhabian image?

Dear H102

Thank you for your support. I did manually install the OpenHab on clean Raspbian Stretch lite OS
however I got failed while starting the Openhabservice.

I would recommend installing OH via apt-get or use the openhabian image.


can you please manually run /usr/share/openhab2/runtime/bin/karaf on the console and tell us the output?

I had the same symptoms when Java/Zulu hasn’t been installed, but that doesn’t seem to be the case here.

Edit: Forget about my first writing: openhab-cli start above says that java command can’t be found. So you would have to investigate this.

But yeah, as @H102 said: OpenHABian would be the easier way. Create a microSD card with the image, connect RPI to the internet, and in about 15 minutes you have your system up and running.


1 Like

Dear Stefan
Thanks for your support,
i’ve that backup plan. however i wanted to dig a bit deeper on this to see which component needed to install OpenHab.

@nhatthanh here is a post that may help as the java command is not found.

thank you H102
as this image is Rasbian Stretch Lite Image so i believe i didn’t include the java (zulu) by default.
so if i install zulu then obviously it must be the default one.
in fact i’ve tried this command and the command returned: there is no other java running on this OS.

OH runs with user openhab and I see above that you have installed java but have you set the correct environment variables to allow openhab access to java?