How to disable Java in configuration files

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

this post is marked as community wiki

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

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.

edit retag flag offensive close merge delete

Comments

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 +0200 )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.

abbygail.mialyn@ln0ut.net gravatar imageabbygail.mialyn@ln0ut.net ( 2018-10-04 07:36:52 +0200 )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 +0200 )edit

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

abbygail.mialyn@ln0ut.net gravatar imageabbygail.mialyn@ln0ut.net ( 2018-10-04 08:00:16 +0200 )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 +0200 )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="http://openoffice.org/2004/java/framework/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <enabled xsi:nil="false">false</enabled> </java>

abbygail.mialyn@ln0ut.net gravatar imageabbygail.mialyn@ln0ut.net ( 2018-10-05 02:02:27 +0200 )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 +0200 )edit