CentOS 8 + Java 11

  • Platform information:
    • Hardware: Raspberry Pi 4B (ARM64) / 4G RAM
    • OS: CentOS 8 (64-bits)

I purchased a Raspberry Pi 4 to replace my old Pi3B with OpenHABian; however, I’m having issues to install Java 11.

I’m aware from the prerequisites (Installation Overview | openHAB) that I Zulu is the recommended version and I should not install the 64-bit Java version, even though my OS is 64-bits.

The first issue I faced is the RPM repository only includes versions 15, 16, and 17 for ARM64. So I had to try the manual installation.

Next, Zulu only provides builds for CentOS x86, not for ARM.
Screen Shot 2021-10-13 at 9.46.30 PM

I tried a more general search (excluding the OS and with the JDK) and found ARM 32-bit HF (zulu11.50.19-ca-jdk11.0.12-linux_aarch32hf.tar) and ARM 32-BIT SF (zulu11.50.19-ca-jdk11.0.12-linux_aarch32sf.tar), but I haven’t figured out which of the two versions is the right one for Rasperry Pi ARM.

I downloaded both of them to my Mac, but they are downloaded in .tar format, not the .tar.gz published on the official page, so the checksum doesn’t match. Nonetheless, I compressed them using gzip and transferred to CentOS via SFTP to a folder I created for SFTP users (/data/sftpuser/upload/). First I decompressed the HF version with the following command:

tar -xzvf /data/sftpuser/upload/zulu11.50.19-ca-jdk11.0.12-linux_aarch32sf.tar.gz

But when I executed

zulu11.50.19-ca-jdk11.0.12-linux_aarch32hf/bin/java -version

I got

-bash: zulu11.50.19-ca-jdk11.0.12-linux_aarch32hf/bin/java: No such file or directory

The file is there, though:

[root@OpenHAB-Server upload]# cd zulu11.50.19-ca-jdk11.0.12-linux_aarch32hf/bin/
[root@OpenHAB-Server bin]# ls
jar        java   javadoc  jcmd      jdb        jdeps  jhsdb   jinfo  jlink  jmod  jrunscript  jstack  jstatd   pack200  rmid         serialver
jarsigner  javac  javap    jconsole  jdeprscan  jfr    jimage  jjs    jmap   jps   jshell      jstat   keytool  rmic     rmiregistry  unpack200

Exactly the same story happened with the SF version.

I checked Oracle Java (https://java.com/en/download/help/linux_install.html#rpm), but it only seems to include versions 7.0 and 8.0

I would appreciate some guidance.

I guess the suggested method to install software in CentOS is via dnf/yum.
I use this config:

# cat zulu-openjdk.repo 
[zulu-openjdk]
name=zulu-openjdk - Azul Systems Inc., Zulu packages
baseurl=https://repos.azul.com/zulu/rpm
gpgkey=https://assets.azul.com/files/0xB1998361219BD9C9.txt
enabled=1
gpgcheck=1
protect=1

Thanks for your prompt response @HaKuNa

The first thing I checked was how to install it with dnf, but then I saw that there was no 32-bits version. So I didn’t even try it.

I didn’t understand how does your config file tells dnf to get the 32-bit version instead of the standard 64-bits for ARM64?

Then I suggest to use openhabian on a raspi. Or buy a „better“ HW if you want to stay on CentOS.

this may help:

For future record, I decided to continue with CentOS 8.0 (64-bits) and, due to lack of options, OpenJDK 11 64-bits.

So far, the main issue I’ve faced is lack of compatibility of some packages with CentOS, e.g. Zulu Java. For the voice service I had to switch from Pico to Mary, because libttspico-utils is not available for CentOS.

Apart from that, the system is more robust than OpenHABian. When I was using OpenHABian on my Pi 3B, the available memory would go from 60% to 0% every week and then a process that could take hours and block everything (including OpenHAB) would increase it, not always back to 60%, sometimes just 10-20%.
CentOS has been running for 19 days and the available memory barely went down to 56%.