OH3: how manually install Zulu 11 on Raspberry Pi 4?

Sorry guys,
I have finally decided to try install OH on my Raspberry pi 4 and I am stuck in the manual installation steps (need to run other stuff on Pi so Openhabian is not a good choice for me)

Problem is the installation of Zulu 11.
first question is: is it really required or the java which comes with the latest raspbian img suffices? Because otherwise I won’t spoil further time in this (and yours as well)
current status is

$ java -version
openjdk version “11.0.9.1” 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-post-Raspbian-1deb10u2)
OpenJDK Server VM (build 11.0.9.1+1-post-Raspbian-1deb10u2, mixed mode)

Supposing Zulu 11 really needs to be installed,
I have tried to follow the manual installation steps in https://www.openhab.org/docs/installation/rasppi.html
in particular where it mentions

Please refer to the Linux article for instructions on how to install the latest Java 11 revision.`

which jumps to the totally unclear (to me) section Meeting the Requirements

to cut the long story short, after squandering some more time in the ocean of pages of azul.com, I understood that to install Zulu on armhf the only way seems to be doing it through tar.gz
So I downloaded zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf.tar from here and I am trying to follow the instructions found here, that is

  1. Download the installation package from Azul Downloads.
  2. Extract the downloaded <zulu_package>.tar.gz file.tar -xzvf <zulu_package>.tar.gzThe command extracts all Zulu files into the <zulu_package> folder in the current directory.
  3. Verify your Zulu installation.

which is missing the installation step I guess, as I end up with a bunch of files in a folder not installed.
So, what should I do to install it? Does anybody know?
Should I follow the directions I read in this thread which is marked outdated - and mentions a change request which should include this in the OH3 UI?

I also tried to install using SDKMAN as follows

  1. install SDK MAN
    curl -s "https://get.sdkman.io" | bash
    and then
    source "/home/pi/.sdkman/bin/sdkman-init.sh"

  2. list the javas
    sdk list java

I gort something like
Available Java VersionsVendor Use | Version | Dist | Status | Identifier


(‘’')

** Azul Zulu | | 15.0.1 | zulu | | 15.0.1-zulu**
** | | 15.0.1.fx | zulu | | 15.0.1.fx-zulu**
** | | 14.0.2 | zulu | | 14.0.2-zulu**
** | | 14.0.2.fx | zulu | | 14.0.2.fx-zulu**
** | | 13.0.5 | zulu | | 13.0.5-zulu**
** | | 13.0.5.fx | zulu | | 13.0.5.fx-zulu**
** | | 12.0.2 | zulu | | 12.0.2-zulu**
** | | 11.0.9 | zulu | | 11.0.9-zulu**
** | | 11.0.9.fx | zulu | | 11.0.9.fx-zulu**
** | | 10.0.2 | zulu | | 10.0.2-zulu**
** | | 9.0.7 | zulu | | 9.0.7-zulu**
** | | 8.0.275 | zulu | | 8.0.275-zulu**
** | | 8.0.275.fx | zulu | | 8.0.275.fx-zulu**
** | | 7.0.282 | zulu | | 7.0.282-zulu**
** | | 6.0.119 | zulu | | 6.0.119-zulu**
** BellSoft | | 15.0.1.fx | librca | | 15.0.1.fx-librca**

(‘’')
================================================================================
Use the Identifier for installation: $ sdk install java 11.0.3.hs-adpt
================================================================================

I used
sdk install java 11.0.9-zulu
which seems to be successfull and it is even telling me that it has changed the default java, unfortunately when I do
sudo update-alternatives --config java
I get this demeaning reply

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-armhf/bin/java

so I am totally confused and don’t know what else to try.

Did anyone already go through this ordeal??

Here’s what worked for me, though I’m on a Pi3:

thanks, I’ll try. Looks like the post I linked above, -the one marked outdated - maybe it shouldn’t . I’ll give it a try

It shows an outdated link to Zulu11, but you can find the latest from the Zulu site. Then as stated I had to modify the tar command. Otherwise, no issues here…

1 Like

thanks, I made it work. There was a sysntax error in sudo tar
Wrong:
sudo tar -xfvz zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf.tar.gz
correct:
sudo tar -xzvf zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf.tar.gz

Installation is made with
sudo update-alternatives --install /usr/bin/java java /opt/jdk/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf/bin/java 1
and
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf/bin/javac 1

moreover, was missing the step of selection of the newly installed, which is performed using:

sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status


  • 0 /usr/lib/jvm/java-11-openjdk-armhf/bin/java 1111 auto mode
    1 /opt/jdk/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf/bin/java 1 manual mode
    2 /usr/lib/jvm/java-11-openjdk-armhf/bin/java 1111 manual mode
    Press to keep the current choice[*], or type selection number: 1
    update-alternatives: using /opt/jdk/zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32hf/bin/java to provide /usr/bin/java (java) in manual mode

Can someone confirm if this manual setup is OK? I’m fresh at Raspbian.

In the end, what an utter pain in the neck. Unbelievable that you have to suffer so much to manually set up OH on a popular device. I’ll propose a change to the doc, this is nonsense.

2 Likes

Yes

Thanks, you have really helped a lot :hugs:

I agree though - I was very surprised when I couldn’t just get Zulu11 from the repos. Not as if a Pi is a niche device…

doc modified detailed the installation process for Zulu11 on Raspberry by edolis · Pull Request #1410 · openhab/openhab-docs · GitHub

1 Like