OPENHAB 2.5.1-2 Install cannot find ZULU-8 java

  • Platform information:
    • Hardware: iMac 2007 Intel® Core™2 CPU T7200 @ 2.00GHz × 2, 2GB Memory, 160GB HDD, Graphics ATI RV530
    • OS: Ubuntu 18.04.3 LTS
    • Java Runtime Environment: ZULU-8 zulu8.30.0.1-jdk8.0.172-linux_i686
    • openHAB version: OPENHAB 2.5.1-2
  • Issue of the topic: Installation fails to find Java
  • Please post configurations (if applicable): N/A
  • If logs where generated please post these here using code fences:
    Fresh Install:
    UBUNTU Installed with no issues

This is my second try after re-installing UBUNTU to an empty volume. I have openhab 2.4 working on an older iMac for more than a year now, wanted to make a new start.

It seems, openhab user created during the install is unable to see java at all. I had exactly the same problem on my first attempt.

Notes from ZULU-8 Java installation:
I’ve been using oracle java with my 2.4 system, since this is a new fresh install, decided to use ZULU.
Followed instructions from https://www.weargenius.in/install-zulu-jdk-on-ubuntu/ no issues as checks below shows:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/zulu-8/bin

$ echo $JAVA_HOME
/usr/lib/jvm/zulu-8

$ sudo update-alternatives --list java
update-alternatives: error: no alternatives for java

$ java -version
openjdk version “1.8.0_172”
OpenJDK Runtime Environment (Zulu 8.30.0.1-linux32) (build 1.8.0_172-b01)
OpenJDK Server VM (Zulu 8.30.0.1-linux32) (build 25.172-b01, mixed mode)

This looks good to me, I have newly installed java 8 as recommended, here’s the output from OH2 install

INSTALL OPENHAB version (2.5.1-2)
$ wget -qO - ‘https://bintray.com/user/downloadSubjectPublicKey?username=openhab’ | sudo apt-key add -
OK

$ sudo apt-get install apt-transport-https
Reading package lists… Done
Building dependency tree
Reading state information… Done
apt-transport-https is already the newest version (1.6.12).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

$ echo ‘deb https://dl.bintray.com/openhab/apt-repo2 stable main’ | sudo tee /etc/apt/sources.list.d/openhab2.list
deb https://dl.bintray.com/openhab/apt-repo2 stable main

$ sudo apt-get update && sudo apt-get install openhab2
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://au.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://au.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://au.archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:5 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Get:7 https://dl.bintray.com/openhab/apt-repo2 stable Release.gpg [821 B]
Get:8 https://dl.bintray.com/openhab/apt-repo2 stable/main i386 Packages [2,541 B]
Fetched 98.1 kB in 3s (36.4 kB/s)
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
Suggested packages:
** zulu-8 | zulu-embedded-8 | oracle-java8-installer | openjdk-8-jdk-headless**
The following NEW packages will be installed:
openhab2
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 83.0 MB of archives.
After this operation, 94.8 MB of additional disk space will be used.
Get:1 https://dl.bintray.com/openhab/apt-repo2 stable/main i386 openhab2 all 2.5.1-2 [83.0 MB]
Fetched 83.0 MB in 35s (2,373 kB/s)
Selecting previously unselected package openhab2.
(Reading database … 185984 files and directories currently installed.)
Preparing to unpack …/openhab2_2.5.1-2_all.deb …
Unpacking openhab2 (2.5.1-2) …
Setting up openhab2 (2.5.1-2) …
[openHAB] Please use the following commands to launch openHAB on a system restart.
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable openhab2.service

[openHAB] You can start openhab2 manually by executing the command:
sudo /bin/systemctl start openhab2.service

[openHAB] WARNING: We were unable to detect Java 8 on your system. This is needed before openHAB can be started.
[openHAB] Please install the current version of Java 8 or check the openHAB documentation for details.
Processing triggers for ureadahead (0.100.0-21) …
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (237-3ubuntu10.33) …

My user can see java:
$ java -version
openjdk version “1.8.0_172”
OpenJDK Runtime Environment (Zulu 8.30.0.1-linux32) (build 1.8.0_172-b01)
OpenJDK Server VM (Zulu 8.30.0.1-linux32) (build 25.172-b01, mixed mode)

Java home is set correctly for openhab user
$ sudo -u openhab echo $JAVA_HOME
/usr/lib/jvm/zulu-8
/usr/bin/jvm/zulu8.30.0.1-jdk8.0.172-linux_i686/bin

Path is correct for openhab user
$ sudo -u openhab echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/zulu-8/bin

openhab cannot see java
$ sudo -u openhab java -version
sudo: java: command not found

SYSLOG Entries:

Jan 26 12:27:05 OpenHAB org.gnome.Nautilus[1831]: javaldx: Could not find a Java Runtime Environment!
Jan 26 12:27:05 OpenHAB org.gnome.Nautilus[1831]: Please ensure that a JVM and the package libreoffice-java-common
Jan 26 12:27:05 OpenHAB org.gnome.Nautilus[1831]: is installed.
Jan 26 12:27:05 OpenHAB org.gnome.Nautilus[1831]: If it is already installed then try removing ~/.libreoffice/3/user/config/javasettings_Linux_*.xml
Jan 26 12:27:06 OpenHAB org.gnome.Nautilus[1831]: Warning: failed to read path from javaldx

No OpenHAB log:
/var/log/openhab2$ ls
Readme.txt

On Ubuntu you should be able to install OpenHABian following the Linux installation instructions. That helps insure the correct packages are installed and correct permissions set.
I am lazy so that is what I tend to do.

2 Likes

Thank you for your reply.

It’s very likely the installation script for 2.5 version is buggy. After the first install I found part of the script that returns the warning message I’m getting. I’ll try to locate it and examine it. I’m not very proficient with Unix/Linux scripting though. It had commands like “awk” etc which I found very cryptic to understand.

Best regards,
Ali Erhan

0414 760780

ae-imaging.photoshelter.com

Thanks Bruce,

I never knew OpenHabian could be utilised with UBUNTU, I got the impression it was for Raspberry PI installations only.

All good it seems now.

1 Like