2

2-8-2020:

While attempting to explore Libreoffice Base on the pi4B 4GB running:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux

I of course began with a sudo apt update and sudo apt upgrade, and a reboot. I then launched LibreOffice Base, selected the option to create a new database, and as soon as I try to begin building tables, or anything, I get the message:


LibreOffice requires a Java runtime environment (JRE) to perform this task. Please install a JRE (and libreoffice-java-common) and restart LibreOffice.


The dialog did not specify that the JRE must be only the oracle distribution, or any particular version number. After doing searches for an hour, and per the recommendation in several posts, I then installed the latest version of openJDK (v11) with the following:

pi@raspberrypi:~ $ sudo apt install default-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  alsa-base gir1.2-gda-5.0 glom-doc gstreamer0.10-alsa
  gstreamer0.10-plugins-base libboost-python1.67.0 libepc-1.0-3 libepc-common
  libevdocument3-4 libevview3-3 libgda-5.0-4 libgda-5.0-common
  libgda-5.0-postgres libgdamm-5.0-13 libgettextpo0 libglom-1.30-0
  libgoocanvas-2.0-9 libgoocanvas-2.0-common libgoocanvasmm-2.0-6
  libgspell-1-1 libgspell-1-common libgstreamer-plugins-base0.10-0
  libgstreamer0.10-0 libgtksourceviewmm-3.0-0v5 libgxps2 libkpathsea6 libllvm8
  libva-wayland2 libxfce4util-bin libxfce4util-common libxfce4util7
  libxfconf-0-2 libxml++2.6-2v5 pimixer point-rpi xfconf
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  default-jdk-headless default-jre default-jre-headless
The following NEW packages will be installed:
  default-jdk default-jdk-headless default-jre default-jre-headless
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.3 kB of archives.
After this operation, 39.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:2 http://raspbian.raspberrypi.org/raspbian buster/main armhf default-jre armhf 2:1.11-71+b1 [1,044 B]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf default-jdk-headless armhf 2:1.11-71+b1 [1,108 B]
Get:1 http://mirrors.syringanetworks.net/raspbian/raspbian buster/main armhf default-jre-headless armhf 2:1.11-71+b1 [11.1 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian buster/main armhf default-jdk armhf 2:1.11-71+b1 [1,060 B]
Fetched 14.3 kB in 1s (11.8 kB/s)       
Selecting previously unselected package default-jre-headless.
(Reading database ... 186330 files and directories currently installed.)
Preparing to unpack .../default-jre-headless_2%3a1.11-71+b1_armhf.deb ...
Unpacking default-jre-headless (2:1.11-71+b1) ...
Selecting previously unselected package default-jre.
Preparing to unpack .../default-jre_2%3a1.11-71+b1_armhf.deb ...
Unpacking default-jre (2:1.11-71+b1) ...
Selecting previously unselected package default-jdk-headless.
Preparing to unpack .../default-jdk-headless_2%3a1.11-71+b1_armhf.deb ...
Unpacking default-jdk-headless (2:1.11-71+b1) ...
Selecting previously unselected package default-jdk.
Preparing to unpack .../default-jdk_2%3a1.11-71+b1_armhf.deb ...
Unpacking default-jdk (2:1.11-71+b1) ...
Setting up default-jre-headless (2:1.11-71+b1) ...
Setting up default-jre (2:1.11-71+b1) ...
Setting up default-jdk-headless (2:1.11-71+b1) ...
Setting up default-jdk (2:1.11-71+b1) ...
pi@raspberrypi:~ $ 

After a restart of everything, LibreOffice Base gave the same error message. It was my understanding that the OpenJDK would also install a JRE. Out of curiosity, I then tried:

pi@raspberrypi:~ $ sudo apt install default-JRE
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package default-JRE
pi@raspberrypi:~ $
pi@raspberrypi:~ $ java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Raspbian-1deb10u1)
OpenJDK Server VM (build 11.0.6+10-post-Raspbian-1deb10u1, mixed mode)
pi@raspberrypi:~ $ 

Although it found no such package, these two commands did show that there was indeed a JRE installed, presumably by the OpenJDK install.

Next, per the error dialog box that LibreOffice so kindly presented to me again, I then made sure the libreoffice-java-common was on the system:

pi@raspberrypi:~ $ sudo apt install libreoffice-java-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libreoffice-java-common is already the newest version (1:6.1.5-3+rpi1+deb10u5).
libreoffice-java-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ 

Alas, I was hasty to conclude that all requirements were then met since apparently there is now the latest recommended OpenJDK JRE on my pi 4B, and the required libreoffice-java-common. After restarting my Pi4B, from a cold boot, and launching LibreOffice Base again, opening the file I am trying to create, and clicking on the Tables in the upper left, I am greeted with the very same error dialog, as if I had done nothing at all to satisfy its requirements.

I then began to wonder if LibreOffice demands only the oracle version of the JRE but found again that those versions are older, more involved to install, and not recommended compared to the OpenJDK in the Raspbian Buster repositories.

Perhaps this is a version problem? Or a path configuration issue?

I have so much to learn. Please educate me on what I need to do, and what I did wrong.

  • 1
    "After a restart of everything, LibreOffice Base gave the same error message", which error message? – M. Rostami Feb 8 at 20:44
  • 1
    @ M. Rostami -- It is quoted, and between two horizontal lines, near the top of the OP. – always_learning Feb 8 at 21:01
  • 1
    Have you installed Oracle JRE? – M. Rostami Feb 8 at 21:02
  • 1
    I installed the recommended default-jdk, as described in the OP, rather than the more involved oracle install, and I still have not concluded the latest oracle installer to try on Pi4B, or how. Been searching all afternoon. Apparently v 13? A link to the installer and instructions that will work, would be wonderful. – always_learning Feb 8 at 21:06
2

As I searched, the LibreOffice Base background codes run by Java Oracle JRE (or in some cases, OpenJDK will work). Therefore, it will work if you install the proper Oracle JRE/JDK on your raspberry pi. Depending on where you choose to install it, you may need to use sudo.

- Create a directory for Java installation:

sudo mkdir /usr/local/java/
cd /usr/local/java/

- Download the required files:

sudo wget https://github.com/frekele/oracle-java/releases/download/8u212-b10/jdk-8u212-linux-arm32-vfp-hflt.tar.gz  

You can download the safest/latest version by this link and add to your raspberry pi.

- Extract the compressed file:

sudo tar xvzf jdk-8u212-linux-arm32-vfp-hflt.tar.gz

- Set alternatives:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_212/bin/java" 1  

sudo update-alternatives --set java /usr/local/java/jdk1.8.0_212/bin/java

- Done. Fire up java -version to check out, will gives you:

java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b10)
Java HotSpot(TM) Client VM (build 25.212-b10, mixed mode)

Finally, launch LibreOffice Base again, open the file you are trying to create, and click on the Tables in the upper left.

| improve this answer | |
  • 1
    Is it needful to fist remove the OpenJDK that was installed from the repository when I did the sudo apt install default-jdk ? That had installed v 11.0.6+10. If some OpenJDK will work also, I suppose that is not one of them, so do I need to completely remove it before attempting to install the v 1.8.0_212, which btw, seems awfully old if the versioning is done the same way? TY for taking the time. – always_learning Feb 9 at 1:23
  • 1
    Ok, update. I see the versioning is different than I supposed. 241 says it is certified for arm, yet the installer is not available for it. So your procedure looks like it would put the most recent certified version, 212, on it for arm processors. Which leaves the other question... must I completely remove the prior OpenJDK version installed with sudo apt install default-jdk? Would that be a simple sudo apt remove default-jdk? – always_learning Feb 9 at 1:41
  • Yes, the latest 8u241 does not have a JRE download for arm processors, but only the full JDK for arm. I am therefore going to try the tarball from frekele github, in your answer, trusting that this particular tarball, on the frekele page, is clean, ie, has not been tampered with, frekele being a type of mirror of older versions from oracle. Though security on this pi4B system is not the highest priority, this situation leads me to not finalizing Base as my chief Pi database solution. But I still want to see this work, so I continue with it later today. I will let you know the result. ty – always_learning Feb 9 at 15:18
  • 1
    @always_learning It doesn't matter which JRE package you installed. You can choose them by sudo update-alternatives --config java. It will give you all list of installed JRE and you can choose one of them (Of course Oracle "1.8.0_212"). – M. Rostami Feb 9 at 17:09
  • @always_learning Ok. Feel free to install that JRE I've added. At first try this one and if you find the solution, you can install the latest Oracle JRE/JDK 8 on your raspberry pi. – M. Rostami Feb 9 at 17:12
1

I ran into the same issue. I did sudo apt install openjdk-10-jre, and then ran libreoffice (not as root).

In the window that comes up, select the Tools menu, Select Options, and then LibreOffice Advanced. Ensure 'Use a java runtime environment is checked', and (at least on my very vanilla Buster system), LibreOffice found the Oracle Corporation 10.0.2 JRE. Select it, if it isn't, then click OK. Close LibreOffice and restart it.

That's it!

| improve this answer | |
  • @ bls - if the schedule frees up, I will start with a fresh buster system and try using the OpenJDK in that way. Would you happen to know the difference(s) between default-openjdk (which installs v 11 instead of 10, as of feb 2020) and the oracle 8 version? It is my understanding that the JDK installer also installs the JRE. – always_learning Feb 10 at 17:09
  • 1
    No, sorry. I bumped into my solution when fiddling around with LibreOffice. The LibreOffice dialog box that I mentioned lets you pick which JRE to use, inferring that you can probably have multiple installed. Not clear to me that you need to re-install, perhaps just run libreoffice and have a look at that dialog box for starters. – bls Feb 10 at 18:35
  • @ bls - this also helps, since apparently the java JRE can be selected in LO, and perhaps may not need to be specified with a shell command first. That would simplify things. The concern here is that if I develop a very simple Base solution for a project, I want the setup to be as simple as possible, for sharing with someone else how to do it, or the easiest possible support. I'd rather not walk someone through first finding a proper installer, and then properly installing and testing it. But sudo default-jdk, and an LO Base single dialog, is easy. weekend projects to test all this. – always_learning Feb 11 at 18:51
  • Good luck! Shout if needed... – bls Feb 12 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.