Java 8 not detected when installing openHAB on Beaglebone Black

  • Platform information:
    • Hardware: Beaglebone Black Rev. C
    • OS: Debian GNU/Linux 10 (buster)
    • Java Runtime Environment: (Zulu 8.50.51.263-CA-linux_aarch32hf) (build 1.8.0_275-b01)
    • openHAB version: 2.5.10
  • Issue of the topic: WARNING: We were unable to detect Java 8 on your system

Need help troubleshooting new openHAB installation on a Beaglebone Black (BBB) Rev C.
Prior to installation of openHAB (apt-get method) Azul Zulu Java for armhf architecture was manually installed and confirmed:

code:
debian@beaglebone:/var/log/openhab2$ java -version
openjdk version “1.8.0_275”
OpenJDK Runtime Environment (Zulu 8.50.51.263-CA-linux_aarch32hf) (build 1.8.0_275-b01)
OpenJDK Client VM (Zulu 8.50.51.263-CA-linux_aarch32hf) (build 25.275-b01, mixed mode)
debian@beaglebone:/var/log/openhab2$
code:

openHAB installation output:
code:
[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.
code:

The path for Java is set for all users, why does the openHAB installation script not find it?

Thanks for any suggestions.

Chris J.

I assume you set the JAVA_HOME environment & set that installation as the default for the operating system as documented there? This appears to be a Debian issue, not openHAB.

This is the check that is being done by the scripts in an apt installer package:

checkJava(){
  # Java must be at least version 8, check for this
  VERSION=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;')
  if [ -z "$VERSION" ] || [ "${VERSION}" -lt "8" ]; then
    printf "${OPENHAB_TEXT} WARNING: We were unable to detect Java 8 on your system. This is needed before openHAB can be started.\n"
    printf "${OPENHAB_TEXT} Please install the current version of Java 8 or check the openHAB documentation for details."
    echo ""
  fi
}

Execute this line:

java -version 2>&1 | awk -F '"' '/version/ {print $2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;'

it needs to return the value 8 or bigger. If it is less then the message is being shown.
In case it returns 8 resp. the output that you provided then I assume that the pass is not set for all users resp. not available for user root.

Thanks for the information. I’ll do a little more research and check that I do in fact have the java path set correctly for all users.

Chris J.

Not the path. The environment variables. Two totally different things.

Bruce, by “java path” I meant environment variable defining the path to the java binary.

After much research I was unable to solve the issue of root not being able to find the Azul Zulu Java I manually installed. I assume the way the root environment is setup on the BBB is somewhat different than a standard Debian installation.

I installed OpenJDK via apt-get and then reinstalled openHAB and the installation completed with no errors. I can also start openhab2.service with no errors and confirmed the process is running. However, the openHAB web UI is not available at http://my_server_IP:8080, and I instead get a message saying “the nginx web server is successfully installed”. Time to do some more research. I’ll open a new topic for that issue if needed.

Thanks for the help.

Chris J.

It also needs to be in the execution path for the user to locate it. I assumed you meant this.

You are also not using hardware floats. only Zulu has that option which impacts performance. That is the main reason Zulu JDK is recommended.

Just wanted to provide an update on my earlier post so this didn’t appear unresolved.
Instead of updating the Debian environment so openHab could find the manually installed Zulu 8 Java installation I added symlinks in /usr/bin/ pointing to the java jre binaries where there were located at
/usr/lib/jvm/zulu8/jre/bin/
With this change openHAB installed with no complaints and the service could be started. However, the openHAB UI would not open from my browser. One more change was needed. Nginx already had a default welcome page configured for port 8080 so it was necessary to edit
/etc/nginx/sites-available/defualt and comment out the server configuration for port 8080. After uninstalling and reinstalling openHAB everything seems to work now running openHAB on my Beaglebone Black Rev. C.
Thanks to Wolfgang_S and Bruce_Osborne for their help with this issue.

1 Like

openHAB requires the JDK, I thought not the JRE.

Per the openHAB installation information https://www.openhab.org/docs/installation/ the requirement is Java Virtual Machine (JVM) which is part of the Java Runtime Environment (JRE). Obviously JRE will be also be available if a full Java Development Kit (JDK) is installed. Azul Zulu Java 8 for ARM32HF architecture is only available as the full JDK so that’s what I installed.
https://cdn.azul.com/zulu-embedded/bin/zulu8.50.51.263-ca-jdk8.0.275-linux_aarch32hf.tar.gz
After unpacking the archive in /usr/lib/jvm/
I renamed the zulu8.50.51.263-ca-jdk8.0.275-linux_aarch32hf directory that was created to zulu8 just to shorten things up a bit. The ownership of the files after unpacking was wrong so it was also necessary to change ownership of the files in the archive to root.
The symlinks I created in /usr/bin/ looked like this:
code:
ln -s /usr/lib/jvm/zulu8/jre/bin/java java
ln -s /usr/lib/jvm/zulu8/jre/bin/jfr jfr
ln -s /usr/lib/jvm/zulu8/jre/bin/jjs jjs
ln -s /usr/lib/jvm/zulu8/jre/bin/keytool keytool
ln -s /usr/lib/jvm/zulu8/jre/bin/orbd orbd
ln -s /usr/lib/jvm/zulu8/jre/bin/pack200 pack200
ln -s /usr/lib/jvm/zulu8/jre/bin/policytool policytool
ln -s /usr/lib/jvm/zulu8/jre/bin/rmid rmid
ln -s /usr/lib/jvm/zulu8/jre/bin/rmiregistry rmiregistry
ln -s /usr/lib/jvm/zulu8/jre/bin/servertool servertool
ln -s /usr/lib/jvm/zulu8/jre/bin/tnameserv tnameserv
ln -s /usr/lib/jvm/zulu8/jre/bin/unpack200 unpack200
code:

Zulu JDK is what is recommended but, of course, there are some Java environment variables that need to be set up too.

Just a thought. OH3 requiring Java 11 will be released in a few days. It might be worth considering that RC2 is already released.

jre directory is always part of the JDK package.
see also https://www.geeksforgeeks.org/differences-jdk-jre-jvm/

I realize that but you did not say you set JAVA_HOME, for instance

When I was trying to figure out what I needed and didn’t need to get openHAB working on the Beaglebone Black (Debian arm32hf) I created a Debian (amd64) VM in VirtualBox checked the environment before and after installing Azul Zulu 8 LTS, oppenHAB, and doing the initial configuration of openHAB and testing openHAB by successfully controlling some TP-Link wireless outlets. I could find no changes to the environment related to the Java installation so I made none to my environment on the Beaglebone Black environment and it seems to be working.

1 Like

@chriswj88,

I’m curious how your BBB is performing for you?

I own one, but started out (for OpenHAB) with a Cubietruck several years ago. Then maybe 1 year ago I upgraded to ODROID-XU4 already due to performance reasons. Since I would consider Cubietruck more performant than BBB (and Cubietruck was already not enough for me), I couldn’t help but to wonder…

I’m still in the very early stages with the project and currently only have one TP-Link KP400 outdoor smart plug being controlled so not a very demanding load at this time. My end goal is to use the openHAB UI to access/control hardware features native to the BBB. No real big plans for it beyond that so I don’t think I’m likely to exceed its processing power with my limited application.

Yes, this is often “how it begins…” :grin: