Today I decided to look at OpenHab2. I’m quite impressed so I decided to install it on my Ubuntu machine.
I installed it with: apt-get install openhab2-online and then I tried to start the service, which failed. After running /usr/share/openhab2/start.sh I get the following error:
Launching the openHAB runtime...
karaf: KARAF_BASE is not valid: /usr/share/openhab2/userdata
I can change the error by creating the folder, but in the end it starts asking for a configuration file. I guess I can’t just make an empty file.
I was having a similar problem with a fresh install of Ubuntu 16.04.1 using either install method of OpenHab. In either case OpenHab would hang without any error message that I could find.
I got it to work by changing versions of Java with the command
sudo update-alternatives --config java
works:
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Java reports version as: openjdk version 1.8.0_111)
did not work:
/usr/lib/jvm/java-9-openjdk-amd64/bin/java
Java reports version as: openjdk version 9-internal
I may have selected the “wrong” version of java when fetching it with apt.
Important!!! For now, you should continue to use Java 8 because Oracle Java 9 is available as an early access release (it should be released in 2016)! You should only use Oracle Java 9 if you explicitly need it, because it may contain bugs and it might not include the latest security patches! Also, some Java options were removed in JDK9, so you may encounter issues with various Java apps. More information and installation instructions (Ubuntu / Linux Mint / Debian): http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html