I’ve been struggling to install Zulu Java 11 and I’ve searched everywhere and cannot find a solution. I assumed it would be simple
I have a manual install of openhab 3 on a raspberry pi 4.
I was hoping I could just apt-get install zulu-11 …
Anyway I tried to find the package and install manually but that did not work. If anyone knows of a solution or can point me to one that would be great thanks.
#go to folder
/usr/lib/jvm
#download
wget -c https://cdn.azul.com/zulu-embedded/bin/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch64.tar.gz
#unpack
sudo tar -xzvf zulu11.43.100-ca-jdk11.0.9.1-linux_aarch64.tar.gz
#create alternative
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch64/bin/java 100
#update to new alternative
sudo update-alternatives --config java
#check version
java -version
I just get an error and nothing works
-bash: /usr/bin/java: cannot execute binary file: Exec format error
I have a custom setup script which I prefer to use and manage.
Out of curiosity can you install openHABian after you have installed everything manually? I’ve already updated openhab to version 3 so in theory updating java should be all I need for now.
Thanks for getting back to me. As I expected it’s probably too late to install. It’s an openHAB instance that I installed before openHABian was available and it has many customisations and openhab items etc. This is why I just want to understand how to install Zulu Java 11 and nothing else. I cannot afford to start from scratch.
Ah that’s good to know! I’ll give that a go. Thanks for that.
Still interested to know how to just update Java to 11 though as I have other items that are not included in the openhab backup script that are a pain to move over and re-configure.
Just summarizing since i was looking for ages (at least one weekend) to find out the right answer howto install java 11 zulu
#go to folder
/usr/lib/jvm
#download
sudo wget https://cdn.azul.com/zulu-embedded/bin/zulu11.43.88-ca-jdk11.0.9-linux_aarch32hf.tar.gz
#unpack
sudo tar -xzvf zulu11.43.88-ca-jdk11.0.9-linux_aarch32hf.tar.gz
#create alternative
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/zulu11.43.88-ca-jdk11.0.9-linux_aarch32hf/bin/java 100
#update to new alternative – select new java version
sudo update-alternatives --config java
#check version
java -version
hey guys I received this error and I am stuck,
error: alternative path /usr/lib/jvm/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch64/bin/java doesn’t exist
why it didn’t create the forlder during the unpaking?
Hi all,
i hope it’s okay if I add this rather general question here, but from my point of view it fits best here.
It is probably a stupid question: but is it mandatory to stop the openhab service before a java update, or does it not matter? To be on the safe side, I would definitely do that, but so far I haven’t found a hint about it in the forums and on other websites. I only ask because I want to better understand the connections between Openhab and Java. I am not using Openhabian, but an installation of Openhab (3.1.1) on Raspberry Pi OS (Debian buster/oldstable).
Yes, I think that helps me. Thank you! So if I understand correctly, I can install the Java version in parallel without stopping the openHAB service, but at the latest when I switch to the new Java version (sudo update-alternatives --config java) I have to restart the service afterwards so that it also uses the new version, correct?