Cant start OpenHAB after first install

HI all
i am a very nood to all this and i am just setting up on a VM on Ubuntu server, i did the apt install and then the manual install and keep getting a issue

adam@HAServer:/tmp$ java -version
openjdk version “10.0.1” 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode)
adam@HAServer:/tmp$ sudo systemctl start openhab2.service
Failed to start openhab2.service: Unit openhab2.service not found.
adam@HAServer:/tmp$ sudo su -s /bin/bash -c ‘/opt/openhab2/start.sh’ openhab
Launching the openHAB runtime…
/opt/openhab2/runtime/bin/karaf: 199: [: Illegal number:
/opt/openhab2/runtime/bin/karaf: 199: [: Illegal number:
Error occurred while checking the system module.

Any help would be great thanks so much cant wait to start using it

Not sure I fully understand:

Does that mean you did both? That would mean that you installed it twice. Please use only one of the installation methods. You may just want to start over and use Openhanbian https://docs.openhab.org/installation/openhabian.html
This can help avoiding many issues regarding missing prerequisites, permissions, etc.

Unless you are using Openhabian, you may want to check the prerequisites in particular regarding the JAVA version; Zulu is likely your best bet; more details : https://docs.openhab.org/installation/index.html#prerequisites

If not done so, please read the beginners tutorial: https://docs.openhab.org/tutorials/index.html

At the moment, openHAB needs Java 8 to run properly. Should be okay after you install that.

Otherwise, don’t have the apt version and the manual version installed at the same time. As the apt version sets environment variables which may stop a manual install from working as intended.

1 Like

I had the same issue and after installing Java version 8 it fixed the problem.

Hi all should have said so sorry I removed one before installing the other , also how do I change the Java version sorry I am a real noon at this

No no sorry i should have been clear i only did one of the installs at a time and removed the last one before i did the other one

You can install multiple versions at the same time. As @lipp_markus mentioned, I’d also recommend Zulu: http://repos.azulsystems.com and install zulu-8

To switch the version, use the command:

sudo update-alternatives --config java