Can not install openhab2 on Ubuntu 16.04.1

Hello everyone,

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

So my question is, how to solve this?

Thanks in advance.

Kind regards,
Lars Jansen

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


  • /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.

1 Like

Interesting. We should add this information to the documentation (I’m on it… done. Will be merged soon).

The last I read in regards to that topic:

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

Thanks for the reply. I saw your reference after I got OH working again. I guess I really should use the real Java instead of JDK.