How to disable Java in configuration files

Hi,

I’m writing automated scripts to deploy LibreOffice to Red Hat hosts, and I’m setting various configuration options using xml files under /usr/lib64/libreoffice/share/registry.

How can I disable Java in a similar fashion? (ie Tools → Options → LibreOffice/Advanced → Use a Java runtime environment). I need this option disabled and locked for all users.

I’ve Googled around but I can’t seem to find the name of the option I need to disable.

Wherever I come across such a problem, I’d backup registrymodifications file, then do the required customization of the setting with UI, and then make a diff of resulting registrymodifications and the backup…

The only “registrymodifications.xcu” file I can find is in my home directory, so the setting wouldn’t be global. Moreover, the file appears not to change when I change the Java setting.

The per-user registrymodification file needs not to be global to give you the name of the setting that you can put into a global .xcd put into share/registry… but yes, you are right, the setting you are talking about is located in user’s javasettings_foo.xml/pack, located in config (pack/config) subdirectory of user’s profile (as modification date hints). Not sure how to add this to .xcd yet.

Using the option found in javasettings_*.xml file would be good, if the setting can go in an xcd file instead.

well - copying the javasettings_*.xml to share/config (and removing all subelements from there except for “enabled”) changes the default… but still doesn’t lock the setting, so user may still change the setting, and this will create this file with overridden settings in user profile.

Do you mean copying the file to /usr/lib64/libreoffice/share/config/javasettings_Linux_X86_64.xml ? Because when I put the file there, with contents as follows, the option doesn’t change.

<?xml version="1.0" encoding="UTF-8"?> false

As I say - when you put a file there, it’s taken as default, i.e., on a new user profile (which doesn’t contain such file in user profile yet) this will be taken into account as the default value, and then might be overridden with what is in user profile’s file.

I don’t know where the LibreOffice’s share/config is on your Linux - sorry; I use windows, so I can only tell that there it’s in LibreOffice installation directory, next to program/.

FYI @AlexKemp:

from today’s IRC chat, where I gave a link to this topic to a person who asked “does anyone know how I can disable libreoffice from using java with no gui?”:

yea I saw that but it sounds like the thread is just inconclusive, not to mention the question is labeled as outdated/not relevant

So the closing is just harmful, without any upside.