Bug 156161 - Organise Macros > Python requires JRE
Summary: Organise Macros > Python requires JRE
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:24.2.0
Keywords:
Depends on:
Blocks: Java-Runtime-JRE-Warnings
  Show dependency treegraph
 
Reported: 2023-07-04 19:31 UTC by LucasLibre
Modified: 2023-09-27 15:57 UTC (History)
3 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 LucasLibre 2023-07-04 19:31:29 UTC
Description:
Each time I start LibreOffice Writer and choose Tools > Macros > Organise Macros > Python … I get the following error message: “JRE Required” “LibreOffice requires a 64-bit Java runtime environment (JRE) to perform this task. Please install a JRE and restart LibreOffice. https://hub.libreoffice.org/InstallJava/?LOlocale=en-GB”. The Python Macros dialog box then appears with various default Macros (Capitalise, Hello World, InsertText, etc.), with the Create, Edit, Rename, and Delete buttons greyed out, but clicking Run on a selected macro runs it without any problems.

Steps to Reproduce:
1. Start LibreOffice Writer
2. Go to Tools > Macros > Organise Macros > Python …

Actual Results:
The following error message appears: “JRE Required” “LibreOffice requires a 64-bit Java runtime environment (JRE) to perform this task. Please install a JRE and restart LibreOffice. https://hub.libreoffice.org/InstallJava/?LOlocale=en-GB”. After clicking OK, the Python Macros dialog box appears with various default Macros (Capitalise, Hello World, InsertText, etc.), but the Create, Edit, Rename, and Delete buttons are greyed out.

Expected Results:
No error message, and the Python Macros Create, Edit, Rename, and Delete buttons should not be greyed out.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
After the error message displays once, it doesn't reappear until LibreOffice is restarted.

As suggested by mikekaganski here: < https://ask.libreoffice.org/t/how-to-add-embedded-images-from-extension-into-writer-doc/93282/13?u=lucaslibre >, I've tried disabling all extensions, and running in Safe Mode, and both times I get the same error message.

I get the same message for the Beanshell and Javascript options under Tools > Macros > Organise Macros, but not for Basic. Without any Beanshell or Javascript default macros, I haven’t tried testing if the Run button works for those languages.

Help > About LibreOffice:
Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded
Comment 1 Dieter 2023-07-25 11:22:15 UTC
(In reply to LucasLibre from comment #0)
> As suggested by mikekaganski here: <
> https://ask.libreoffice.org/t/how-to-add-embedded-images-from-extension-into-
> writer-doc/93282/13?u=lucaslibre >, I've tried disabling all extensions, and
> running in Safe Mode, and both times I get the same error message.

Mike, any further ideas? As far as I understand your post at ask.libreoffice you can't confirm it.
Comment 2 Mike Kaganski 2023-07-25 12:59:28 UTC
(In reply to Dieter from comment #1)

You are right; I can't. But possibly someone would be able to repro, find out the specific requirements, and then it would become actionable.
Comment 3 Alex Thurgood 2023-07-25 15:05:26 UTC
@Lucas : could you provide us with a list of your extensions, irrespective of whether they are active or not ?


The most common reasons for the triggering of such an error message are:

- extensions (as Mike has already pointed out on the AskLO thread)- are you using the LanguageTool extension, for example ?

- active database files requiring a Java bridge (e.g. Basic macros for manipulating HSQLDB embedded databases ?
Comment 4 LucasLibre 2023-07-30 11:43:15 UTC
Just got this message. The only extensions I have installed are the default ones:
* English spelling dictionaries, hyphenation rules, thesaurus, and grammar checker (2022.11.01)
* French spelling dictionary, hyphenation rules, and thesaurus (7.0)
* Solver for Nonlinear Programming (0.9)
* Spanish spelling dictionary, hyphenation rules, and thesaurus for all variants of Spanish. (2.6)
* Wiki Publisher (1.2.0)
I also this Hello World extension installed while I was trying out extension development, but the issue persisted when it was not installed: https://wiki.documentfoundation.org/Development/Create_a_Hello_World_LibreOffice_extension

No macros or database files (let alone Java bridges, etc.) that I'm aware of.

There's a chance my Windows 10 installation might have something to do with it? I think I had previously had installed a JDK (probably x64, but there is a chance it was x86) on this computer several years ago. I must have uninstalled it at some point, and reinstalled Windows 10, keeping my user account, but removing all programs. Java/JDK/JRE didn't show up in the auto-generated "Apps removed while resetting your PC" list. But maybe some environment variable/registry setting persisted?

I've just tried installing the current x86 JRE, and still got the same error message. I then installed x64 JRE as well, and the error message disappears. When I uninstall them both, the error message returns.
Comment 5 Mike Kaganski 2023-07-30 15:59:33 UTC
Repro.
Steps:

1. Have a JRE/JDK of properarchitecture.
2. In LO, make sure to enableuse  of JRE, *and select a JRE from the list* (i.e., a dot must be displayed on the radiobutton  next to that JRE under options->LibreOffice->advanced).
3. Open Tools->Macros->Organize Macros->Python
=> See that there's no warning
4. Close LibreOffice
5. Uninstall the chosen JRE from system.
6. Open LibreOffice, and checkstep 3.
=> The "JRE missing" warning appears.
Comment 6 Mike Kaganski 2023-07-31 02:27:07 UTC
https://gerrit.libreoffice.org/c/core/+/155078
Comment 7 Commit Notification 2023-07-31 14:46:51 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#156161: Honor "DontEnableJava" when failed because selected JRE uninstalled

It will be available in 24.2.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 8 LucasLibre 2023-08-22 22:57:44 UTC
I tried the latest daily master build from here: https://dev-builds.libreoffice.org/daily/master/ (Win-x86_64@tb77-TDF dated 2023-Aug-09 06:44) and unfortunately still got the same error messages (see also bug 156701).

Help > About LibreOffice:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c3cf88f73e29a79f890782b31d1ecc6ed1c376ea
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded
Comment 9 LucasLibre 2023-08-22 23:13:03 UTC
(In reply to Mike Kaganski from comment #5)
> 2. In LO, make sure to enableuse  of JRE, *and select a JRE from the list*
> (i.e., a dot must be displayed on the radiobutton  next to that JRE under
> options->LibreOffice->advanced).

Just to say I got these error messages without having to enable or select the JRE; just install JRE, open and close LibreOffice, then uninstall JRE.

I also got the same error messages when installing the daily build *after* uninstalling JRE.