Bug 83753 - LibreOffice does not take into account JAVA_HOME and PATH to select JRE
Summary: LibreOffice does not take into account JAVA_HOME and PATH to select JRE
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.4.0.0.alpha0+ Master
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:4.5.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-11 08:24 UTC by Michael Weghorn
Modified: 2014-12-16 08:40 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weghorn 2014-09-11 08:24:37 UTC
When the Java Runtime Environment (JRE) to be used by LibreOffice is automatically detected by LibreOffice (e.g. on the first start of the program), the JAVA_HOME and PATH environment variables are currently not taken into account, i.e. they have no effect on the JRE that is selected.

Possibly it would be a good idea to prefer the Java installations which these environment variables refer to over other Java installations on the system as they (JAVA_HOME, PATH) generally indicate which JRE should be used on the system.
Thus, users/administrators can control which JRE is used if multiple JREs are installed on the system. Therefore, I think this setting should be taken into account by LibreOffice as well.

It would also offer administrators an easy possibility to set a specific JRE for LibreOffice by providing a startup script that first sets the JAVA_HOME environment variable before starting LibreOffice (e.g. in large companies).
Comment 1 Michael Weghorn 2014-09-11 08:31:28 UTC
I have submitted a patch to Gerrit that implements this (https://gerrit.libreoffice.org/#/c/11392/) and would be very glad to receive feedback on both, the general idea, and the patch.
Comment 2 Commit Notification 2014-12-15 15:46:58 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=40138cee6b6f19a7725f3ce9316f285b86366a06

fdo#83753: consider JAVA_HOME and PATH when selecting JRE

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 3 Michael Weghorn 2014-12-15 22:55:25 UTC
The functionality is now implemented on "master". JREs indicated by JAVA_HOME or PATH are preferred over others.
Comment 4 Commit Notification 2014-12-16 08:40:39 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=555f024f16d4407be3c9b0dbb15fb18c2f6f3b20

Related fdo#83753: Fix JVM_ONE_PATH_CHECK feature again

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.