Ask Your Question

Why is Java needed for running macros on Libreoffice?

asked 2018-09-24 13:28:10 +0100

Pau gravatar image

I get the message: "Libreoffice requires a Java runtime environment" whenever I try to use macros, but I am curious about why it is needed. Anyone has an answer? Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-09-24 16:59:37 +0100

Mike Kaganski gravatar image

updated 2018-10-08 13:17:44 +0100

It is a kind of bug. LibreOffice does not need Java to run macros written in other languages (=StarBasic or Python). But the process of finding a script provider in LibreOffice takes each registered script provider until it finds one that handles a given script; and when there's a Python macro in LibreOffice, it happens that Python provider is alphabetically after Java provider; so the process here is this:

  1. LibreOffice found some script (it is actually a Python script)
  2. It starts enumerating providers; first is BASIC - it rejects (does not handle this kind of scripts)
  3. Next provider is for Java. If it is disabled, now you see the warning. If you allow here, the script provider is activated, then tests the script, and naturally rejects. If you don't allow, it is skipped.
  4. Then Python provider is tested, and it accepts the script.

Hope this helps understanding the process. I tried to come with a quick fix, but here something more substantial is needed than a quick fix.

Edit 2018-10-08: addressed in tdf#120362 and tdf#120363 for version 6.2.

edit flag offensive delete link more


Hi @Mike Kaganski - Thank you for this explanation that I had never read before. I upvote your answer :)


pierre-yves samyn gravatar imagepierre-yves samyn ( 2018-09-24 17:18:24 +0100 )edit

Well - this is related to my (incorrect) comment to this topic. I then tried to find the problem, and to fix that... unsuccessfully.

Mike Kaganski gravatar imageMike Kaganski ( 2018-09-24 23:40:49 +0100 )edit

Thanks Mike!

Pau gravatar imagePau ( 2018-10-08 16:58:54 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-09-24 13:28:10 +0100

Seen: 163 times

Last updated: Oct 08 '18