Bug 124503 - LibreOffice doesn't detect JVM because of unexpected java.vendor property value
Summary: LibreOffice doesn't detect JVM because of unexpected java.vendor property value
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.2.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:6.3.0 target:6.2.4 target:6.1.6
Keywords:
: 124855 (view as bug list)
Depends on:
Blocks: Java-Runtime-JRE
  Show dependency treegraph
 
Reported: 2019-04-02 15:27 UTC by Olivier Tilloy
Modified: 2020-09-02 12:47 UTC (History)
10 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 Olivier Tilloy 2019-04-02 15:27:42 UTC
Originally reported in Ubuntu: https://launchpad.net/bugs/1822839.

A recent OpenJDK update in Ubuntu 19.04 (to be released later this month) changes the value of the "java.vendor" property, from the well-known name "Oracle Corporation" to "Private Build".

This breaks the code in LibreOffice that detects an installed JVM, because the vendor name is validated against a hardcoded list: https://cgit.freedesktop.org/libreoffice/core/tree/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx?h=libreoffice-6-2#n33.

This change can probably be reverted in Ubuntu, but I'm wondering what the purpose of that hardcoded list of vendors is? Isn't it a valid use case for distributions to change the vendor name?
Comment 1 V Stuart Foote 2019-04-02 16:49:52 UTC
So a new string would go into the OS build appropriate XML... 

https://opengrok.libreoffice.org/xref/core/jvmfwk/distributions/OpenOfficeorg/

I would guess "Private Build" should be innocuous. But, why is Ubuntu causing itself grief rolling a "Private Build" when the AdoptOpenJDK is community provided? But oh well...

@Stephen?
Comment 2 V Stuart Foote 2019-04-02 16:55:15 UTC
> @Stephen?

Sorry,  s/Stephen/Stephan
Comment 3 Thorsten Behrens (allotropia) 2019-04-03 09:08:56 UTC
See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926009#42
Comment 4 Stephan Bergmann 2019-04-03 09:50:25 UTC
This knowledge about java.vendor strings encoded in a javavendors.xml is unfortunately at the heart of how module jvmfwk works internally.  I'm looking into changing that at least for current master (towards LO 6.3), so that jvmfwk assumes that a JRE with a java.vendor not listed in javavendors.xml can be used by LO.
Comment 5 Stephan Bergmann 2019-04-03 09:53:01 UTC
(Comment 4 notwithstanding, it would nevertheless be useful if distros like Debian and Ubuntu wouldn't start to rename java.vendor strings from the well-known Oracle to something else.)
Comment 6 Olivier Tilloy 2019-04-03 13:11:36 UTC
I don't have control over what the OpenJDK packages in Debian/Ubuntu are using as a vendor name, but here is some related info:

Possible vendor strings for the Debian/Ubuntu OpenJDK builds are now "Debian", "Ubuntu", and "Private Build", the latter trying to identify a PPA build according to the version number.

$ java -XshowSettings -version 2>&1 | grep vendor
    java.specification.vendor = Oracle Corporation
    java.vendor = Ubuntu
    java.vendor.url = https://ubuntu.com/
    java.vendor.url.bug = https://bugs.launchpad.net/ubuntu/+source/openjdk-lts
    java.vm.specification.vendor = Oracle Corporation
    java.vm.vendor = Ubuntu
Comment 7 Olivier Tilloy 2019-04-03 13:15:34 UTC
And the following distro patch was confirmed to work in Debian by Rene: https://salsa.debian.org/libreoffice-team/libreoffice/libreoffice/blob/master/patches/java.vendor-Debian.diff, so I will do something similar for the Ubuntu packages.

And I guess this should be upstreamed in some form, to ensure that the debs built and distributed by TDF are able to find the JVM on Debian/Ubuntu?
Comment 9 Commit Notification 2019-04-09 20:32:48 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/3d27b2fa9c5a03f78e5145377402f8a88e3da1be%5E%21

tdf#124503: Support JRE installations with unknown java.vendor property

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Stephan Bergmann 2019-04-10 08:25:50 UTC
(In reply to Commit Notification from comment #9)
> Stephan Bergmann committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/+/
> 3d27b2fa9c5a03f78e5145377402f8a88e3da1be%5E%21
> 
> tdf#124503: Support JRE installations with unknown java.vendor property
> 
> It will be available in 6.3.0.

See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2019-April/082446.html> "On backporting fix for tdf#124503 'LibreOffice doesn't detect JVM because of unexpected java.vendor property value'" for a discussion whether and how to backport that.
Comment 11 Commit Notification 2019-04-11 16:03:58 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/feca4bf320ae33dd1926f3a1afdc77c3b4f7b2a4%5E%21

tdf#124503: Support JRE installations with unknown java.vendor property

It will be available in 6.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2019-04-11 22:20:42 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/c4aa8b366fb879b0dd37241e70c5842825305620%5E%21

tdf#124503: Support JRE installations with unknown java.vendor property

It will be available in 6.1.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Buovjaga 2019-04-20 11:37:25 UTC
*** Bug 124855 has been marked as a duplicate of this bug. ***
Comment 14 mechtilde 2019-04-20 11:56:37 UTC
.
Comment 15 Alex Brooks 2019-05-14 14:30:08 UTC
This bug is no longer reproducible in

Version: 6.2.4.1 (x64)
Build ID: 170a9c04e0ad25cd937fc7a913bb06bf8c75c11d
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-GB (en_GB); UI-Language: en-GB
Calc: threaded
Comment 16 Xisco Faulí 2019-05-14 14:38:41 UTC
(In reply to Alex Brooks from comment #15)
> This bug is no longer reproducible in
> 
> Version: 6.2.4.1 (x64)
> Build ID: 170a9c04e0ad25cd937fc7a913bb06bf8c75c11d
> CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
> Locale: en-GB (en_GB); UI-Language: en-GB
> Calc: threaded

Thanks. setting to VERIFIED