Openhabian-config Java update

Hi,

I just broke my Raspberry openhabian installation by trying to install Java 17 via openhabian-config.

My Raspberry Pi OS is Bullseye (11.6)

When I executed the change via openhabian-config it apparently removed my older JDK (which presumably was zulu11 but not sure). At least some JDK existed before which is now gone since openhab does not start anymore.
openhabian-config tried to install
apt-get install --download-only --yes openjdk-17-jre-headless
which failed
E: Unable to locate package openjdk-17-jre-headless
because I think that there was an apt update missing earlier since “deb Index of /debian unstable main” was added before.

But even trying to replay manually:
The following packages have unmet dependencies:
openjdk-17-jre-headless : Depends: libc6 (>= 2.34) but 2.31-13+rpi1+deb11u3 is to be installed

So to me it looks like Bullseye is too old for openjdk-17-jre-headless ? Isn’t bullseye the latest RaspberryPiOS ?

2 Likes

I first recovered by reinstalling zulu11 (via openhabian-config worked)

Then I found that I need
deb http://archive.raspberrypi.org/debian/ bullseye main
and not
deb http://deb.debian.org/debian/ unstable main
which was added by openhabian-config.

With that I got openjdk-17-jre-headless which I could install and it seems my openhab 3.4.4 is more or less happy with that version in preparation for migration to 4.0.

Still I think openhabian-config has an issue here.

Slightly offtopic but apparently 3.4.4 does not like Java 17 much. After having constant 100% CPU of openhab I switched back to zulu11 for the time being

Make sure that you have an up to date Java 11 JVM platform installed on your host system.

WARNING. Please note that versions of Java higher than 11 are not supported at the moment.

openHAB 4 will use Java 17.

No, buster is. I don’t think that openHABian maintains backward compatibility with older releases like bullseye and stretch.

I did see posted somewhere that there is a deb package of openJDK that could be installed manually which gets around the libc6 problem. I can’t seem to find that at the moment though.

No, bullseye it is. Debian v11 vs buster v10.

I fixed the repo in openHABian main (I think).
Please try it.

Right, that’s what I meant. Need more coffee.

While you are right let me point out this statement from openhabian/NEWS.md at main · openhab/openhabian · GitHub

As upcoming openHAB 4 will require Java 17 to run, it’s time to move so from now on we install Java 17 by default. NOTE: openHAB 3.X is said to work with but isn’t thoroughly tested on Java 17 so you might run into issues when you install 3.X. This is also a request to all of you to gather and share experiences. Please switch to (via menu) the main branch of openHABian or install it right away as using the default branch (openHAB3) will keep installing Java 11 for the time being. Let us know your feedback via forum. You can also change java versions via menu or on install via openhabian.conf.

I understood that it’s possible to switch and share feedback via the forum. This is what I did :wink:

2 Likes

I had encountered a similar problem when I used openhabian to upgrade to openjdk17 on top of Buster in January. I believe I made the suggestion in the forum on the order of things to wait for a successful Java17 installation before stopping openhab and zapping the old java11 path. (Maybe I only thought about it. :confused:).

For instance when I manually upgraded to zulu 17 (not ready for either a fresh install or O/S upgrade at that time), I downloaded and installed the tar.gz all while OH was running. Also then set the Zulu17 priority above the JDK 11 version (But keeping it as an option) before I restarted OH. If there was a problem (there wasn’t), I could reset the java priorities back to 11 and restart OH.