How to disable Java in configuration files [closed]

asked 2018-10-04 07:26:51 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.


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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-08-10 00:04:38.733469


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...

Mike Kaganski gravatar imageMike Kaganski ( 2018-10-04 07:31:53 +0100 )edit

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. gravatar ( 2018-10-04 07:36:52 +0100 )edit

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.

Mike Kaganski gravatar imageMike Kaganski ( 2018-10-04 07:47:33 +0100 )edit

Using the option found in javasettings_*.xml file would be good, if the setting can go in an xcd file instead. gravatar ( 2018-10-04 08:00:16 +0100 )edit

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.

Mike Kaganski gravatar imageMike Kaganski ( 2018-10-04 08:49:57 +0100 )edit

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.

<java xmlns="" xmlns:xsi=""> <enabled xsi:nil="false">false</enabled> </java> gravatar ( 2018-10-05 02:02:27 +0100 )edit

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/.

Mike Kaganski gravatar imageMike Kaganski ( 2018-10-05 09:42:58 +0100 )edit

FYI @Alex Kemp:

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.

Mike Kaganski gravatar imageMike Kaganski ( 2020-08-14 00:48:23 +0100 )edit