LibreOffice snap : JRE broken of absent

Today my system updated the snap of LibreOffice to version 24.2.1.2. I immediately tried to run it, but I got an error message, stating ‘LibreOffice requires a Java runtime environment (JRE) to execute this task. The selected JRE is broken. Choose or install another version of JRE through Extra – Options – Advanced.’ (see 1st attachment). In updating the snap of LibreOffice I had already experienced similar problems with the JRE in the past. Most of the time one could resolve this by going to the menu Extra-Options-LibreOffice-Advanced and there select one of the mentioned versions on the screen. I tried to do this also this time but no JRE version was shown (see 2nd attachment). I tried to add one but I couldn’t, because the jre folders are not accessible for the snap version of LibreOffice. As a provisional solution I tried to revert back to version 24.2.0.3. This version worked fine before, but when reverted to it, I got the same message about the lacking of a JRE and again no version shown on the Extra - Options - LibreOffice - Advanced screen.

I hope that this problem can be resolved by the snap team, or (1) by updating the version and make sure that all required parts to make the app run, including the JRE, are included in the snap environment or (2) by informing me and other users with the same problem how to install the package within the snap environment for LibreOffice snap to be able to recognize its presence and indicate it on the ‘Advanced’ screen.

I have been a happy user of the LibreOffice snap for quite some time now (and a happy snap user in general for many years) but if I don’t manage to resolve this problem I will have to re-install the deb version, I’m afraid.

My system is Ubuntu 22.04.4. See 3d attachment.

Neofetch

This morning a new build (311) has been uploaded as latest/candidate. I have refreshed the snap channel and installed this new build, which RESOLVES the problem!! I hope it can and will be moved towards latest/stable asap. I have checked its functionality by starting a new database and received no error messages whatsoever. See screenshot: Private Build + location.

1 Like

I’m glad you’re working again, but it’s bizarre. I see zero difference between revision 310 and 311 at all?

Yeah, it is bizarre. That is exactly the reason why I was so worried yesterday evening, even losing part of my night’s rest. I have three Ubuntu machines with LibreOffice as snaps and they all gave the same result. I have now refreshed the channel of a second machine towards revision 311 and this gives the same, positive result. A JRE is found and can be selected, making LibreOffice fully functional. There should be some explanation for this I guess. Anyway, moving 311 towards latest/stable will resolve the problem. I don’t know whether other users have experienced the same problem, but I guess at least some of them have the same experience. For this reason it would be nice if 311 could be moved towards latest/stable, even if no differences can be seen.

Given 310 and 311 are the same, I wonder if this might be a local problem

Note that in your screenshot you have the location as /snap/libreoffice/311/usr/lib/jvm/java-17-openjdk-amd64 - that’s not right, and will almost certainly bite you again when you come to update LibreOffice. Because once you get some more updates beyond 311, that “311” path will be invalid/inaccessible.

I suspect you probably want to have /snap/libreoffice/current/usr/lib/jvm/java-17-openjdk-amd64 in there. That way it will track the next revision (and all subsequent revisions) correctly.

I don’t think the snap is broken at all.

Difficult for me to immagine that the problem should be local. One can only install a snap as a whole. Except for yesterday evening I never even tried to install a JRE manually. It is part of the installation I guess or at least identified (or not) as such by the system. All my machines do exactly the same, although they are - within the Ubuntu 22.04 framework - quite different (hardware, linux kernel etc…). It is the system itself that selected the path as indicated. I can’t change the path (even though the path you mentioned is there!!), because if I try to select it in the menu Extra - Options - Advanced, as soon as I try to open the directory ‘snap’ it says that it can’t read/open this folder. Which is normal I suppose given the fact that snaps are containerized and the snap directory is a system directory and not one that is part of the home-folder of the user.

Yes, my point is at some point a previous release probably pointed to /snap/libreoffice/3XX/usr/lib/jvm/java-17-openjdk-amd64 where 3XX is some number other than 310 or 311. When you updated to 310 the link would be broken because the system only keeps two revisions, and your previous /snap/libreoffice/3XX/ folder has been deleted, so the JVM is inaccessible. By changing the path, you manually fixed it. But I do believe it will break again in the future.