Bug 112723 - Java-based extension installation leads to unhelpful error message when Java is not present or not found
Summary: Java-based extension installation leads to unhelpful error message when Java ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: lowest enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack, skillCpp, topicUI
: 69040 (view as bug list)
Depends on:
Blocks: Java-Runtime-JRE Extension-Manager
  Show dependency treegraph
 
Reported: 2017-09-28 14:57 UTC by Alex Thurgood
Modified: 2022-05-15 22:39 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of error message (100.44 KB, image/png)
2017-09-28 14:59 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2017-09-28 14:57:39 UTC
Description:
Attempting to install the LanguageTool extension leads to the display of an unhelpful error message :

"Could not create Java implementation loader"

Steps to Reproduce:
1. Install a daily dev build
2. Try to install the latest version of the LanguageTool extension (currently 3.9)
3. Note the error when the install attempts to proceed

Actual Results:  
Displays an unhelpful error

Expected Results:
Should display a message that the user can work with, something useful like "You need a JRE/JDK" or "You  have an incorrect JDK version installed, please try a different one."


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0
Comment 1 Alex Thurgood 2017-09-28 14:59:20 UTC
Created attachment 136589 [details]
Screenshot of error message
Comment 2 Yousuf Philips (jay) (retired) 2017-09-28 15:05:23 UTC
Setting to NEW as steve said it happened to him as well.

There are two occurrences of the text 'Could not create Java implementation loader' in the code.

https://opengrok.libreoffice.org/xref/core/stoc/source/javaloader/javaloader.cxx
Comment 3 Yousuf Philips (jay) (retired) 2017-09-28 15:12:31 UTC
I can confirm that i see the same error dialog if i disable the java checkbox in the options dialog, so likely seeing this error just means that java isnt detected/enabled.

Version: 6.0.0.0.alpha0+
Build ID: 892c719fffa06de4c7aeab497326cad7bae9e5c6
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-09-27_03:02:09
Locale: en-US (en_US.UTF-8); Calc: group
Comment 4 Yousuf Philips (jay) (retired) 2017-09-29 03:41:21 UTC
As this error message is invoked from multiple places, we need a generic message that works everywhere, something like "Java is required for this operation but wasn't found. Please ensure that it is enabled and active in Tools > Options > Advanced."

Adolfo, Heiko, Stuart: any suggestions on the text.

Maxim, Samuel: does this text correctly cover all scenarios for when the message would appear. also the text is found twice in the file, so can we unify the string so translators only have to translate it once.
Comment 5 Heiko Tietze 2017-09-29 07:44:39 UTC
(In reply to Yousuf Philips (jay) from comment #4)
> "Java is required for this operation but wasn't found. Please ensure 
> that it is enabled and active in Tools > Options > Advanced."

'Enabled and active' might be confusing. How about "Please ensure to have Java Runtime Environment (jre) installed on your system and enabled in LibreOffice under Tools > Options > Advanced."
Comment 6 QA Administrators 2018-09-30 02:50:02 UTC Comment hidden (noise)
Comment 7 QA Administrators 2020-09-30 03:58:45 UTC Comment hidden (noise)
Comment 8 Timur 2022-04-28 09:24:38 UTC
Heiko, this is rather old, is this easy hack to ask Seth to do it?
Comment 9 Heiko Tietze 2022-04-29 06:53:24 UTC
Let's ask him.
Comment 10 sdc.blanco 2022-04-29 07:51:43 UTC
https://gerrit.libreoffice.org/c/core/+/133493
Comment 11 Stephan Bergmann 2022-05-03 10:17:02 UTC
(By the way, that this somewhat unhelpful error message is displayed when the extension is installed is because that LanguageTool extension still internally uses the obsolete active component registration.  If it used passive component registration instead, see <https://wiki.documentfoundation.org/Documentation/DevGuide/Extensions#Passively_Registered_UNO_Components>, then installing the extension would succeed without error, and only when the extension is then actually used would it bring up the more useful "Enable JRE?  LibreOffice requires a Java runtime environment (JRE) to perform this task. However, use of a JRE has been disabled. Do you want to enable the user of a JRE now?" dialog.)
Comment 12 Heiko Tietze 2022-05-10 08:52:34 UTC
Outcome of the review at https://gerrit.libreoffice.org/c/core/+/133493 is that internal error messages should not be translated (nor give hints on the UI). 

Stephan: "That the code in ExtensionCmdQueue::Thread::execute (desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx) uses such exception messages and displays them to the user is somewhat unfortunate."

So we need to match the "msg = e->Message;" somehow (ideally not comparing the actual text) with a localizable string and show this.
Comment 13 Stephan Bergmann 2022-05-10 09:08:38 UTC
Quoting my comment at <https://gerrit.libreoffice.org/c/core/+/133493/5#message-fc109a0d0165084112f4ad77e4d62bc833349c76> "tdf#112723  improve error message when JRE not available":  "I guess there is no easy fix for this issue, and given my [comment 11 above], I wonder if it would be better to just live with the unhelpful dialog for the (uncommon?) case where an extension using legacy active Java component registration meets an installation where no JRE has been installed yet.  (And rather nudge the LanguageTool developers to update their extension to use passive component registration.)"
Comment 14 Timur 2022-05-10 14:21:19 UTC
I decrease to Lowest Enhancement. Or this could be WontFix.
Comment 15 sdc.blanco 2022-05-15 22:39:05 UTC
*** Bug 69040 has been marked as a duplicate of this bug. ***