How to let the JAVA8 work with openHAB in linux?

Dear All

  • Platform information:

    • Hardware:
      CPU: AMD A6-6400K APU with Radeon™ HD
      Graphics
      RAM:
      total used free shared buff/cache available
      Mem: 3132 1607 581 118 943 1185
      Swap: 7627 0 7627
      Storage
      NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
      sda 8:0 0 232.9G 0 disk
      ├─sda1 8:1 0 100M 0 part
      ├─sda2 8:2 0 116.4G 0 part
      ├─sda3 8:3 0 53.1G 0 part /
      ├─sda4 8:4 0 1K 0 part
      ├─sda5 8:5 0 7.5G 0 part [SWAP]
      ├─sda6 8:6 0 46.6G 0 part /home
      └─sda7 8:7 0 9.3G 0 part /windows

    • OS:
      Linux 4.15.0-50-generic

    • Java Runtime Environment: which java platform is used and what version
      java version “1.8.0_211”
      Java™ SE Runtime Environment (build 1.8.0_211-b12)
      Java HotSpot™ Server VM (build 25.211-b12, mixed mode)

    • openHAB version:
      The openHAB can not run. I have no idea how to check the version of the openHAB2. But I used the openHABian to update the openHAB2. I believe it is the lastest version.

  • Issue of the topic:
    I used apt way to install the openHAB2 step by step. when I use the “sudo systemctl status openhab2.service”. I found the “status=1 failure” in the following output.

openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor pre
Active: activating (auto-restart) (Result: exit-code) since Tue 2019-05-28 15
Docs: https://www.openhab.org/docs/
https://community.openhab.org
Process: 14718 ExecStart=/usr/share/openhab2/runtime/bin/karaf ${OPENHAB_START
Main PID: 14718 (code=exited, status=1/FAILURE)

and I used " sudo journalctl -u openhab2.service -b" to check running log.
May 28 14:44:11 DIT systemd[1]: Started openHAB 2 - empowering the smart home.
May 28 14:44:11 DIT karaf[2502]: java command not found
May 28 14:44:11 DIT systemd[1]: openhab2.service: Main process exited, code=exited, status=1/FAILURE
May 28 14:44:11 DIT systemd[1]: openhab2.service: Failed with result ‘exit-code’.
May 28 14:44:16 DIT systemd[1]: openhab2.service: Service hold-off time over, scheduling restart.
May 28 14:44:16 DIT systemd[1]: openhab2.service: Scheduled restart job, restart counter is at 1.
May 28 14:44:16 DIT systemd[1]: Stopped openHAB 2 - empowering the smart home.
May 28 14:44:16 DIT systemd[1]: Started openHAB 2 - empowering the smart home.
May 28 14:44:16 DIT systemd[1]: openhab2.service: Main process exited, code=exited, status=1/FAILURE
May 28 14:44:16 DIT systemd[1]: openhab2.service: Failed with result ‘exit-code’.
May 28 14:44:22 DIT systemd[1]: openhab2.service: Service hold-off time over, scheduling restart.
May 28 14:44:22 DIT systemd[1]: openhab2.service: Scheduled restart job, restart counter is at 2.
May 28 14:44:22 DIT systemd[1]: Stopped openHAB 2 - empowering the smart home.
May 28 14:44:22 DIT systemd[1]: Started openHAB 2 - empowering the smart home.
May 28 14:44:22 DIT karaf[2535]: java command not found
May 28 14:44:22 DIT systemd[1]: openhab2.service: Main process exited, code=exited, status=1/FAILURE
I noticed the JAVA command can not be found.
So I thought maybe something wrong with the JAVA8.
I use “java -version” can output the version information.
I try to view the openhab dashboard website. it also did not work.
Could you help me ?
Thank you so much.

Benjamin

Hello :slight_smile:
Welcome to openHAB2.

Have you tried a different version of Java 1.8 ?

For example the Azul Zulu 8 ?

https://www.openhab.org/docs/installation/linux.html#meeting-the-requirements

Thank you for your advice. I will try. by the way, should i set up environment variable for the openHAB2.
sudo vim /etc/profile

1 Like

An environment variable shouldn’t be needed, for OH to work.

Thank you for your suggestions