An Odyssee to upgrade Java 21

Actual I will update OH from 4.3 to 5.0.1. It’s running on a raspberry PI 5 Debian Bookworm.

Every try to upgrade Java from 17 to 21 comes up with errors. The package will not be found, it’s equal if I want use the Temurin version or try to use Oracle.

I have no clue anymore

Can someone help me ?

I had some troubles installing it, too. Missing packages and dependencies.

What worked for me was

sudo apt --fix-broken install

Downloaded the JDK 21 deb package, I think from Installing Azul Zulu CA DEB-Packages on Linux

Installing the JDK from the deb file

sudo apt install ./zulu21.44.17-ca-jdk21.0.8-linux_arm64.deb

Why don’t you simply use openHABian? It’ll handle that for you.

1 Like

over a long time I work with this config and have no problems in the past. Further I have some other application running on this raspberry and I’m not sure if these works. On another location I use the docker container, it works too but it can only use for openhab.

maybe, the recommend java for linux is Temurin but it’s not possible to install.

I tried to install Zulu but there are also problems.

I download the package like described on the zulu side but if I start the installation I get this error messages.

I use the fix

but same result.

have someone an idea ?

well, that obviously has no meaning for the problem in the present, right?

openHABian is just scripts to configure Linux. Just check it out.
There’s no reason to believe openHABian would not work with any other Linux app.

I don’t understand this but will note that the OH docker containers include an appropriate java. No need to install separately unless you have some other reason

Yes, what I want mention is that it also restricted.

I wondering that there is a version of OH for Linux available but the Java packages, equal which one I tried, doesn’t work.

Please excuse my sarcasm, but I love these chat responses along the lines of “why do you use MS Office? Why don’t you use LibreOffice?” :wink:

Sure, I can use OpenHabian, but that means setting up everything from scratch, migrating all the databases (be it the persistence or the influxDB), all in all, a lot more work. I already had that with the switch to OH 3.

Thanks a lot, but then I’ll wait until there’s a Java 21 or higher version that can be installed on a Raspberry Pi. There’s no need; 4.3 runs great and is really very stable.

You should be able to install Temurin JDK 21 manually. It is used by openHABian and runs very well on a Raspberry….

That’s not a proper comparison and your sarcasm ain’t appreciated.
Here you attempt to do everything manually although there is a package built and maintained to relieve you (and all OH users) from all the difficulties you’re now asking people to help you with, one by one.
You can easily import OH and even InfluxDB data so not a big deal and no valid reason either.

I only suggested docker because it looked like you had it running somewhere else and it would bypass any installation issues. Just trying to help. Apologize.

For your DIY approach when you do get a java 21 downloaded, I’d suggest getting familiar with the update-alternatives commands (use AI) so that OH uses the version you want it to. Example

xxxxxxxx:~$ 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/temurin-21-jdk-amd64/bin/java    2111      auto mode
  1            /usr/lib/jvm/java-17-openjdk-amd64/bin/java   1711      manual mode
  2            /usr/lib/jvm/temurin-21-jdk-amd64/bin/java    2111      manual mode

The most likely problem is that you have a 32 bit OS installed, where Java21 is only available for a 64 bit OS. See also this topic.

The fact that the adoptium repository you added is showing “armhf” is giving this away, together with the later post of trying to install zulu, where apt is complaining that the arm64 libraries are unavailable.

You need to do an upgrade of your OS to 64 bit, basically meaning a completely new OS installation. So take the time to document what you have installed and configured and do a new installation, where OpenHabian is most likely to be the best suited choice. It is questionable if there will ever be a 32 bit version for java21 available.

Sorry for not being able to provide a useful workaround for your situation. To be honest, I am in the same boat with a 32 bit OS on my raspberry. That was a poor installation decision (not paying enough attention) on my end, over four years ago.

There are not official supported packages available:

I was 100% sure I had a 64-bit system, but now I’ve discovered it’s a 32-bit system.

Unfortunately, that means starting all over again :-/ and reinstalling everything.

Thanks to everyone for the help!