Bug 163485 - LO should not complain about failing to load javaldx if installed without Java package & Java is missing
Summary: LO should not complain about failing to load javaldx if installed without Jav...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Java-Runtime-JRE console-noise
  Show dependency treegraph
 
Reported: 2024-10-17 09:57 UTC by Eyal Rozenberg
Modified: 2024-11-12 07:45 UTC (History)
0 users

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 Eyal Rozenberg 2024-10-17 09:57:16 UTC
On some systems, on which you've installed LibreOffice 24.8.2 packages but not libreoffice-java-common, when you start LO, you get this:

Warning: failed to launch javaldx - java may not function correctly

in particular, you get the message even if there is no JRE on the system at all.

This should not be printed. When there is no reason to assume Java can be used - javawhatever should not be loaded; and if for some reason it does make sense to opportunistically try and load it - it is not a failure for that attempt to fail and the user should not be warned about it.

See also some discussion of this with Michael Weghorn on bug 163468: I was sure the crash reported there had to do with Java issues, because it came after the warning, but actually that wasn't the issue at all, and the console noise misdirected me.
Comment 1 Aryeh 2024-11-07 23:15:33 UTC
This could be helpful https://ask.libreoffice.org/t/where-do-i-find-package-libreoffice-java-common/50712

Also, can you include the version you are using like I am below?

Version: 24.8.2.1 (AARCH64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 8; OS: macOS 14.5; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 2 Eyal Rozenberg 2024-11-07 23:32:03 UTC
(In reply to Aryeh from comment #1)
> https://ask.libreoffice.org/t/where-do-i-find-package-libreoffice-java-
> common/50712

I'm not looking to install it, just saying that the message should not be printed.

> Also, can you include the version you are using like I am below?

Unfortunately, I cannot, since I no longer have the machine, but it should not matter, because the point is the condition checked in the code for that warning to be printed.

If you must know... it was an i686 machine, running the Q4OS GNU/Linux distribution v5.5 (32-bit).
Comment 3 Mike Kaganski 2024-11-12 07:45:32 UTC
The message should not show at all, together wit all the other debug output that we disable in release builds. At the point where we call it [1], we can't even know if we have Java enabled, or if we need Java.

If needed, we should store the result in a variable for future reference. At the very least, if we truly *have to* emit it to the console (it would be a headless invocation), we must do that at that later stage, when we are requested to actually load Java. We could also show that message in a GUI, when we report Java loading failure, as a hint what could cause it (in interactive invocation).

I believe, that this message is one most important reason for people to believe that LibreOffice is Java-based; while in reality, this is just a side effect of *some* platforms' loaders specifics, that don't allow setting some variables at a later stage. Quoting sberg from IRC:

> at least for some old JREs that was/is needed on some Unixy, that's why we
> have that javaldx
> at least on some platforms, it's env vars we need to set that are read once by
> the dynamic loader upon start, and later changes would be ignored by the dynamic
> loader ...
> but maybe the original need for javaldx has gone with contemporary JREs, I
> can't remember the details off the top of my head

I.e., if we don't do this early enough - even before we even know if we *need* Java, we can't later load Java (but most possibly we won't have to). That's why it exists, which doesn't mean it's required for correct operation of everything that doesn't need Java. Yet, Google suggests, that people struggle hard fixing this message, which in ~100% is unrelated to their problems.

[1] https://opengrok.libreoffice.org/xref/core/desktop/unx/source/start.c?r=b4295077&mo=18630&fi=663#610