openHAB 5.x-SNAPSHOT requires Java 21

Yes, I checked it

getconf LONG_BIT
64

I wonder how I got there and how I should fix this? The “only” thing I did was initiating the openHAB upgrade to the latest milestone and saw it failing. I then checked what was failing and saw it was java failing. I also tried to install java 21 temurin via openhabian-config which failed, too. I then ran the failing java installation command that I saw from the logs which I posted above. So no tinkering with it beforehand.
Thankfully it did not corrupt the installation, so jdk17 is still running and open 4.2.0 as well.

No, it is an open issue in Debian.
We (openHABian) retrieve openJDK from the unstable Debian repo. It is located only there because it is not yet considered to be stable by Debian developers and @stefan.hoehn what you see is stuff that happens (and will continue to) all along the way when some complex software combo like a Linux package or even OH to rely on it is on its journey of maturing.

You can attempt to install Temurin for the time being.

But AFAIK there is no Java 21 package available yet that can be considered to be ready for prime time. So

this clearly is not right.
Sure: as a dev to handle your OS-Java-whatever prerequisites yourself you’re okay with that.
As a general recommendation for other devs - no. Let alone for users.

These quotes are used in the wrong context. My question was in relation to openHAB being fully compatible with Java 21. The point you are making is different.

So, did I do something wrong, Markus?

Or do you just consider JDK21 not ready yet for openhabian?

if then, how do I install openHAB 5.x? I thought it requires JDK21 and at least it seems upgrading to openHAB 5.0 automatically upgrades to 21.

As I already wrote:

We will be looking after getting openjdk21 to install as time permits (there’s already an open openHABian issue for it). But the main statement is not to count on this because as long as the Debian maintainers consider the package to be unstable, this can happen again at any time.
Other than that, as much as you may dislike this state of uncertainty, there just is no recommendation and I will not be providing any guidance how to proceed.

I have been using Zulu Java 21 on my dev system. Installed via openHABian long time ago.
As it seems, this has been removed from openHABian with commit Add official support for Java 21 (#1940) · openhab/openhabian@6f5beda · GitHub.

openjdk packages from Debian repo seem to be problematic right now (as we get close to the end of the 2y-release cycle of Debian, our base libs get quite outdated). Java 21 is available in testing and unstable:

Debian -- Details of package openjdk-21-jre-headless in sid (this is what is used by openHABian right now).
But both seem to require (different) libc6 newer than the one provided by our bookworm base image. For standard bookworm installs, likely openjdk is no longer an option until Debian release and the following raspios release mid of the year.

@stefan.hoehn
Did you try Termuin 21? I just gave it a try, installed it via openHABian. For me, it works out of the box.

FWIW, I found this walk-through:
https://www.reddit.com/r/java/comments/1b7yp39/comment/ktlqrd5/

Yes, I tried but it seems that something broke my system (just to mention it, it did not try upgrade anything except go to the latest milestone via openhabian-config).

Florian already gave the hints to remove

/etc/apt/preferences.d/limit-unstable

UPDATE: (based on Florians hint below)
wrong: /etc/apt/sources.list.d
correctRemoved java.list out of /etc/apt/sources.list.d

and then try to install temurin like explained here:

but already

sudo apt install -y wget apt-transport-https gpg

fails with libc errors again…

even though I dared to

sudo apt --fix-broken install

it fails in the end.

The good news, though, that it did not break my system in a way: openHAB still runs.

AFAIK the RPI requires

uname -m
aarch64

which relates to alpine linux. I am not a linux expert but I wonder if that would run on debian which openhabian is?

you removed the whole dir??? I hope not.
Try to install openJDK17 first then Temurin 21 next.

Correction:

Removed java.list out of /etc/apt/sources.list.d

1 Like

No, only these files (I actually moved them and not delete → update above)
Ok. I’ll try:

/etc/apt $ java -version
openjdk version “17.0.14” 2025-01-21
OpenJDK Runtime Environment (build 17.0.14+7-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.14+7-Debian-1deb11u1, mixed mode, sharing)

To me it seems that the attempt to install OpenJDK 21 from Debian Trixie Repository on Debian Bullyseye caused apt to upgrade libc6 and other libs to the Trixie version which in the end „broke“ the installation.

apt now does not install anything new due to dependency issues.

@mstormi
IMO we should abandon that hacky OpenJDK approach and only provide Temurik OpenJDK builds which are actually built for Bullseye/Bookworm. Keep in mind that Debian Trixie‘s OpenJDK build is build for Debian Trixie‘s dependencies versions and not for older Debian.

I posted a script to easily install GraalVM JDK 21 here:

in case you prefer GraalVM over Temurin

Well abandon, no. I’m sure in the long run it’s going to be openjdk that most will use.

But you’re right for the time being.
So we just changed openHABian so if you choose OH5 there it’ll now install Temurin.

1 Like

Markus, when did you change this? I download openhabian around 2 hrs again with raspberry pi imager and I have

openjdk version "21.0.6" 2025-01-21
OpenJDK Runtime Environment (build 21.0.6+7-Debian-1)
OpenJDK 64-Bit Server VM (build 21.0.6+7-Debian-1, mixed mode, sharing)

after a fresh install. If there is even newer version, I would then rather again start from scratch…

Also I tried to install influx on that fresh install and it fails with

E: The repository ‘InfluxData - Package Repository trixie Release’ does not have a Release

Configuring InfluxDB... OK
2025-03-04_18:29:48_CET [openHABian] Configuring Grafana... OK
2025-03-04_18:29:58_CET [openHABian] Installing InfluxDB...
$ influxdb_install admin 0p3nh@b1@n
2025-03-04_18:29:58_CET [openHABian] Adding required keys to apt... OK
2025-03-04_18:29:58_CET [openHABian] Installing InfluxDB...
$ apt-get update
Hit:1 http://davesteele.github.io/comitup/repo comitup InRelease
Hit:2 http://phoscon.de/apt/deconz generic InRelease
Hit:3 http://deb.debian.org/debian bookworm InRelease
Hit:4 http://archive.raspberrypi.com/debian bookworm InRelease
Hit:5 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:6 http://deb.debian.org/debian bookworm-updates InRelease
Hit:7 http://deb.debian.org/debian unstable InRelease
Hit:8 https://deb.nodesource.com/node_18.x bookworm InRelease
Ign:9 https://repos.influxdata.com/debian trixie InRelease
Err:10 https://repos.influxdata.com/debian trixie Release
  404  Not Found [IP: 2600:9000:2057:aa00:11:fe8d:7d40:93a1 443]
Hit:11 https://openhab.jfrog.io/artifactory/openhab-linuxpkg testing InRelease
Get:12 https://pkgs.tailscale.com/stable/debian bookworm InRelease
Reading package lists... Done
E: The repository 'https://repos.influxdata.com/debian trixie Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
FAILED (update apt lists)

So maybe it is also trying to install influx from trixie due to the openJDK installation?

What do you recommend?

It was in main repo, not in openHAB repo which is what the imager uses.
I’ve now forwarded it there, too so it should work this time.

On Influx, frankly I don’t care, but you should be removing any references to testing and unstable repos from your apt sources files then apt should not use them.

Ok, I will try again the new version from scratch and hopefully then there is no Trixie and also the openhabian influx installation will work then too.

I imaged openhabian today via the “raspberry Pi Imager” and just let it install until it is finished.

By default it is openHAB 5.0.0.M1 and java 21.0.6 is automatically installed:

openjdk version "21.0.6" 2025-01-21
OpenJDK Runtime Environment (build 21.0.6+7-Debian-1)
OpenJDK 64-Bit Server VM (build 21.0.6+7-Debian-1, mixed mode, sharing)

So, a fresh installation still seems to have openJDK (I can’t try an upgrade, because the old 4.x system is not usable anymore, which would probably get temurin).

Can we also make the default java temurin for the clean install for the time being?

That doesn’t make sense as per default it will not install any milestone but OH4.

Provide a “maximum” debuglevel log of the installation that also shows what you did.