config jre for openoffice3.0

 config jre for openoffice3.0

     如果使用openoffice解析word文件,大家知道是需要配置jre的,一般做法是这样的:

  1. 启动openoffice
  2. 选择Tools-->Options
  3. 选择OpenOffice.org下的Java选项
  4. 然后选择适当的jre,点击OK,重启openoffice即可,如下图:

设置openoffice的jre选项

问题:

      openoffice默认的jre是系统自带的,可以通过如上方式换成我们常用的JDK版本,但是如果服务器是批量生产的,如上的手动设置岂不太过繁琐?如何通过命令或者脚本更改呢?

通过查阅openoffice官方文档,有如下描述:

The configuration is stored in

 

Just delete this file if you want StarOffice to detect again. The Java configuration file cannot be modified manually. The data format is not specified and may change anytime without further notice. Don't try to modify that file to change the Java version. The < location > and < version > entries are only for 'documentation', the Java version is accessed via the < vendorData > , which is binary.

解决方法:

使用locate命令查找javasettings配置文件,发现位于如下目录:

 

将一个已经配置好JRE的服务器上的openoffice配置文件(javasettings_Linux_x86.xml)拷贝到尚未配置的机器上,启动openoffice,果然好了,特记录之。

附录

javasettings_Linux_x86.xml文件内容如下:

 

注意:本文件仅可替换,不可修改,< vendorData >中的内容才为真正的版本号说明。

原文地址:https://www.cnblogs.com/hehe520/p/6330204.html