Bug 144695 - Oracle Java JDK 17 recognition confusion on macOS
Summary: Oracle Java JDK 17 recognition confusion on macOS
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.1.5.2 release
Hardware: ARM macOS (All)
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:7.3.0 target:7.2.5
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-24 07:02 UTC by Alex Thurgood
Modified: 2021-12-06 13:28 UTC (History)
1 user (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 Alex Thurgood 2021-09-24 07:02:26 UTC
Description:
Oracle has released Java JDK 17 under a new licence, making it available for use for everyone from businesses to personal users alike with no fees.

This version is not recognized by LibreOffice


Steps to Reproduce:
1. Download and install Oracle Java (SE) JDK version 17 
2. Start LibreOffice.
3. On macOS, open the LO Preferences dialog (on other OSes Tools > Options menu)
4. Click on Advanced.
5. The Java selection dialog should be displayed.
6. Note that the Oracle Java 17 JDK is recognized in the dialog (but not necessarily selected if other JDKs are also recognized.
7. Select the radio button next to the Oracle 17 Java JDK
8. Restart LibreOffice
9. On next start, a message is displayed saying that no JRE could be found and that one is required.
10. Open a HSQLDB embedded database ODB file in LibreOffice.
11. Click on the Tables icon on the left hand side of the main DB UI window.
12. Error message displayed - no Java found.


Actual Results:
JDK 17 from Oracle not found despite being detected in Advanced Preferences

Expected Results:
The JDK should be found and be functional


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.1.5.2 / LibreOffice Community
Build ID: 85f04e9f809797b8199d13c421bd8a2b025d52b5
CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 1 Alex Thurgood 2021-09-24 07:09:45 UTC
Changed title to reflect on the fact that LO7152 requires the x64 JDK, rather than the aarch64 version.

This will inevitably lead to confusion as it does not seem possible to download and install both x64 and aarch64 DMG packages.

LibreOffice currently only functions with the Oracle x64 JDK DMG / version, but recognizes the aarch64 version if it is installed.
Comment 2 Stephan Bergmann 2021-09-24 08:45:17 UTC
(In reply to Alex Thurgood from comment #1)
> LibreOffice currently only functions with the Oracle x64 JDK DMG / version,
> but recognizes the aarch64 version if it is installed.

Yes, there is no code (in jvmfwk/) that would check that a given JDK installation contains a jvm dynamic library of the same architecture as the LO installation (and which would thus actually be usable by the LO installation; an error that currently only manifests when LO eventually tries to instantiate that jvm dynamic library in-process).

(This is similar to the end-user confusion on Windows with 32-bit x86 vs. 64-bit x86-64 mismatches between LO and JDK installations.)
Comment 3 Alex Thurgood 2021-09-30 09:53:08 UTC
Depending on the level of user sophistication, it is possible to have both aarch64 and x64 JDKs on a M1 system, but requires manually tweaking the uncompressed tarball names that can be downloaded, instead of using the DMGs provided by Oracle.

In the Java setup dialog, the corresponding paths are then displayed when a JDK version is selected :

e.g. 

/Library/Java/JavaVirtualMachines/jdk-17_x64.jdk/Contents/Home

or 

/Library/Java/JavaVirtualMachines/jdk-17_aarch64.jdk/Contents/Home


However, this is clearly not ideal for the casual user.
Comment 4 Stephan Bergmann 2021-11-17 12:51:26 UTC
(In reply to Stephan Bergmann from comment #2)
> (This is similar to the end-user confusion on Windows with 32-bit x86 vs.
> 64-bit x86-64 mismatches between LO and JDK installations.)

(which, for Windows only, has been addressed with <https://git.libreoffice.org/core/+/9143dd4ebe37b608e43d04434cf831624bf55b65%5E!/> "Related tdf#54443 List only matching JREs")
Comment 5 Commit Notification 2021-11-17 15:54:37 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f05a42ef8c8192186f91a169047742e5c3ae9b9e

tdf#144695 VendorBase::isValidArch also for macOS

It will be available in 7.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 6 Commit Notification 2021-11-18 14:01:27 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/a7e36439bc79580b92e4b2636a831b1b0e64c6e8

tdf#144695 VendorBase::isValidArch also for macOS

It will be available in 7.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 7 Christian Lohmaier 2021-12-06 13:28:48 UTC
7.2.4 was a hotfix release, updating target in status-whiteboard