Javaldx: Could not find a Java Runtime Environment!

Hi,

I have a Bash script that uses LibreOffice (version 3.5.7.2) in order to open a spreadsheet (calc).

The script first makes a backup of the directory ~/.config/libreoffice/3/user and creates a mount point at that path as a ramfs filesystem.
To that mount point, it creates a file named registrymodifications.xcu with content that is known in advance (it simply disable some features of LibreOffice).
Also, the file registrymodifications.xcu configures LibreOffice’s temporary directory to reside on a ramfs filesystem that is mounted in /tmp, having an arbitrary name (using mktemp).

After performing this procedure, the Bash script uses LibreOffice the open the spreadsheet document. Then, the following error is shown:

javaldx: Could not find a Java Runtime Environment! 
Please ensure that a JVM and the package libreoffice-java-common
is installed.
If it is already installed then try removing ~/.libreoffice/3/user/config/javasettings_Linux_*.xml
Warning: failed to read path from javaldx

How do I solve this problem and make the error go away?

Obvious question: did you try what the error message says? Do you have a JVM and the package libreoffice-java-common installed? If you do, did you try to remove the mentioned file?

Load Java like it says to.

I had a similar problem.

To fix this, I simply downloaded OpenJDK from Ubuntu synaptic.

If removing ~/.libreoffice/3/user/config/javasettings_Linux_*.xml doesn’t work neither, you can try removing

~/.config/libreoffice/3/user/config/javasettings_Linux_*.xml

or

~/.config/libreoffice/4/user/config/javasettings_Linux_*.xml

with:
rm ~/.config/libreoffice/[3,4]/user/config/javasettings_Linux_*.xml

On Ubuntu 18.04 this helped:

sudo apt-get install default-jre libreoffice-java-common

OK I could install jre but what if I do not want to install a jre?

I have unchecked the “Use java” checkbox in Preferences.

Still I get the “failed to read path from javaldx” warning each time I start libreoffice.

My environment: fresh Xubuntu, in a virtual machine.

This is just a warning. How is it a problem?