Page 1 of 1

[Solved] Getting the selected JRE path from Open Office

Posted: Fri May 27, 2016 9:31 am
by rubal
I do not want to install Java or JRE in the project that creates my open office calc project heavy to execute and is difficult to run on any OS with jars attached. Hence, I want to know the way to extract the path of jre selected in Open Office(Tools>Options>OpenOffice>Java) in any OS where my OXT file is installed via java. I am using UNO package for it.

Re: Getting the selected JRE path from Open Office

Posted: Fri May 27, 2016 10:13 am
by RoryOF
This is not an immediate answer, but it may help you. On a linux machine the Java path is stored in
/home/<UserName>/.openoffice/4/user/config/javasettings_Linux_X86_64.xml

As this is a plain text file extraction of the path should be simple. I have not found (not exhaustive search) an API routine to return the Java path, but there may be one.

Re: Getting the selected JRE path from Open Office

Posted: Fri May 27, 2016 12:11 pm
by rebecca223
Can't find an API routine as well....Any help?

Re: Getting the selected JRE path from Open Office

Posted: Fri May 27, 2016 12:25 pm
by Villeroy
As long as you don't use add-in functions written in Java, the spreadsheet functionality does not depend on any Java code. Apart from one or two seconds on first start, disabling Java won't yield any gains in performance. However, you may be able to get massive performance improvements by using a Java database to store data and dump selected records into your spreadsheet application.

Re: Getting the selected JRE path from Open Office

Posted: Fri May 27, 2016 2:22 pm
by RoryOF
The solution will probably be to access the file I named (or its local equivalent if a different operating system) and extract the information. This should be a simple task in any language.

Re: Getting the selected JRE path from Open Office

Posted: Sat May 28, 2016 9:44 am
by rubal
RoryOF wrote:This is not an immediate answer, but it may help you. On a linux machine the Java path is stored in
/home/<UserName>/.openoffice/4/user/config/javasettings_Linux_X86_64.xml

As this is a plain text file extraction of the path should be simple. I have not found (not exhaustive search) an API routine to return the Java path, but there may be one.
Hey, I think this suits my needs, I can use this file to get the JRE path in Linux. I need to check for different OS that works in similar condition. Thanks to you "RoryOF". :D

Re: Getting the selected JRE path from Open Office

Posted: Sat May 28, 2016 10:06 am
by rubal
Villeroy wrote:As long as you don't use add-in functions written in Java, the spreadsheet functionality does not depend on any Java code. Apart from one or two seconds on first start, disabling Java won't yield any gains in performance. However, you may be able to get massive performance improvements by using a Java database to store data and dump selected records into your spreadsheet application.
I am using Java as development language and working on Apache Open Office project( OXT is being used in Open Office), hence Java is required.

Re: Getting the selected JRE path from Open Office

Posted: Sat May 28, 2016 3:52 pm
by rubal
I need to know the similar way path to file quoted by "RoryOF" for Windows, I am not able to find that directory that might be containing the JRE path selected in Open Office (Tools>Options>OpenOffice>Java).

Re: Getting the selected JRE path from Open Office

Posted: Sat May 28, 2016 5:33 pm
by RoryOF
Outside of OpenOffice bore down through your OpenOffice User Profile until you start to match the path I quoted, probably at the user folder.

Re: Getting the selected JRE path from Open Office

Posted: Sat May 28, 2016 8:23 pm
by rubal
RoryOF wrote:Outside of OpenOffice bore down through your OpenOffice User Profile until you start to match the path I quoted, probably at the user folder.
Thank you, I found it.