Maybe I don’t have zulu 11. This is what the java -version showed:
java version “1.8.0_201”
Java™ SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot™ 64-Bit Server VM (build 25.201-b09, mixed mode)
Maybe I don’t have zulu 11. This is what the java -version showed:
java version “1.8.0_201”
Java™ SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot™ 64-Bit Server VM (build 25.201-b09, mixed mode)
That is java 8. For OH3 java 11 is required.
I did the openHABian menu to install it. Not sure what happened.
how can I install it manually? I tried through openHABian again and then checked and it’s still java 8
You used menu entry 45 and zulu 11 was shown there ?
Closing openhabian-config menu after installation also shows that zulu 11 was installed ?
Yes, tried that through the openHABian menu, but it never worked. It was still java 8. Now I’m messed up more after I tried the link below to install it. After executing those commands I get this when I check the java version:
-bash: /usr/bin/java: cannot execute binary file: Exec format error
right. exec format error is the wrong binary format for your hardware.
What does
file -L /usr/bin/java
show ?
and what does e.g.
file /bin/ls
show ?
/usr/bin/java: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.26, BuildID[sha1]=aea2077415200ba36a0077f97a06a977726c32d7, not stripped
/bin/ls: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=2f15ad836be3339dec0e2e6a3c637e08e48aacbd, for GNU/Linux 3.2.0, stripped
Could you check which files you have in /etc/apt/sources.list.d/ .
Especially what is the content of files that start with zulu in the name.
You wrote you restored a backup from PI to PC. That is about OH2 / OH3 backup not a complete system backup, right ?
Not sure, what you mean. This is what I did:
zulu-embedded.list zulu-openjdk.list.distUpgrade
iconnor-ubuntu-zoneminder-xenial.list.distUpgrade nodesource.list.save openhab.list.distUpgrade webupd8team-ubuntu-java-xenial.list zulu-embedded.list.distUpgrade zulu-openjdk.list.save
iconnor-ubuntu-zoneminder-xenial.list.save openhab2.list.distUpgrade webupd8team-java.list webupd8team-ubuntu-java-xenial.list.distUpgrade zulu-embedded.list.save
nodesource.list openhab2.list.save webupd8team-java.list.distUpgrade webupd8team-ubuntu-java-xenial.list.save zulu-openjdk.list
Which files do you need contents?
All the zulu files have one line at the top, with a # sound in front of it
Try to run
dpkg-query --showformat '${Status}\t${Package}\t${Version}\t${Architecture}\t${Origin}\t${Section}\n' -W | column -ts $'\t' | grep zulu
This should list the installed java packages from zulu repositories.
Check the architecture column. There must be at least one package that is not amd64 nor x86 but arm.
Note down the package names of the arm packages.
Deinstall them with
sudo apt-get remove package-name
Remove the file zuluzulu-embedded.list ( or rename the extension to zulu-embedded.list.old )
Then update the repository cache: sudo apt-get update
What is the content of
zulu-embedded.list
zulu-openjdk.list
Do a
dpkg -l | grep java
They appear to be all amd64
mike@openhab:~$ dpkg-query --showformat '${Status}\t${Package}\t${Version}\t${Architecture}\t${Origin}\t${Section}\n' -W | column -ts $'\t' | grep zulu
install ok installed zulu-8 8.99.0.0-1 amd64 oldlibs
install ok installed zulu8 8.0.282-1 amd64 java
install ok installed zulu8-ca 8.0.282-1 amd64 java
install ok installed zulu8-ca-doc 8.0.282-1 amd64 java
install ok installed zulu8-ca-jdk 8.0.282-1 amd64 java
install ok installed zulu8-ca-jdk-headless 8.0.282-1 amd64 java
install ok installed zulu8-ca-jre 8.0.282-1 amd64 java
install ok installed zulu8-ca-jre-headless 8.0.282-1 amd64 java
install ok installed zulu8-doc 8.0.282-1 amd64 java
install ok installed zulu8-jdk 8.0.282-1 amd64 java
install ok installed zulu8-jdk-headless 8.0.282-1 amd64 java
install ok installed zulu8-jre 8.0.282-1 amd64 java
install ok installed zulu8-jre-headless 8.0.282-1 amd64 java
This is all that’s in the 2 files:
The result looks a bit unexpected. I expected to see the arm package as well.
It could be that that java is not part of a zulu package or not installed via apt.
Did you manually install java by using wget and untarring it ?
There are other files that contain java and end in .list. Are they used to install java as well or are this java apps ?
Could you try the following command to check if there are any non amd64 packages installed:
dpkg-query --showformat '${Status}\t${Package}\t${Version}\t${Architecture}\t${Origin}\t${Section}\n' -W | column -ts `\t' | grep -v amd64
Where is the java link pointing to ? Could you please check where the java binary link is pointing to by doing following steps ( the second and third one needs to be adapted based on each previous result ):
ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jun 14 2020 /usr/bin/java -> /etc/alternatives/java
ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 43 Dez 20 12:22 /etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
dpkg -S /usr/lib/jvm/java-11-openjdk-amd64/bin/java
openjdk-11-jre-headless:amd64: /usr/lib/jvm/java-11-openjdk-amd64/bin/java
In this case openjdk-11-jre-headless is the package that is behind the active java version.
Wolfgang,
I appreciate you trying to help me. But this is getting a little complicated for me. I think I might try a fresh reinstall of Ubuntu to see if that fixes anything. Thanks again!
Hi @MikeH,
You should be okay to simply install Java 11 from a package. If this is a relatively new version of Ubuntu, then:
sudo apt install default-jdk
Otherwise:
sudo apt install openjdk-11-jdk
And then you can check again with
java -version
I don’t think openHABian supports Ubuntu which may have caused the error. @mstormi shouldn’t we check and warn for this?
You will be better off with installing the openHABian image.
It’s prominent in the README. To be frank I don’t have much pity when people fail because they didn’t read it.
Well OH3 never goes well even with openhabian setup - at least for me
What you need to do is:
Stop OH
sudo systemctl stop openhab.service
sudo mkdir /opt/jdk
cd /opt/jdk
dpkg --print-architecture
sudo wget http://cdn.azul.com/zulu-embedded/bin/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf.tar.gz
sudo tar -xzvf zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf.tar.gz
sudo update-alternatives --install /usr/bin/java java /opt/jdk/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf/bin/javac 1
sudo update-alternatives --config java
((You'll be prompted to select the alternative, pick the zulu11 you've just installed.))
sudo rm *.tar.gz
sudo systemctl start openhab.service
Sometimes its better to sudo restart.
That helps me each time
It does for most. If it does not for you please help find out why so we can enhance it for everybody’s benefit.
Do you run Ubuntu ? What HW ?
Set debugmode=maximum
before you run openhabian-config and select OH install or upgrade.
I will do it next time - yes I always install openhabian on Ubuntu 20.04 or 20.10 (but it mostly goes with Zulu problems more complex on 20.10).
On next update - if client will pay for it I will perform max logging and post it here. Or if i will put my hands on some RP3/4 I will do it for community (dont have ona atm).