Bug 1131425 - libreoffice drags in java-1.8.0-openjdk, but it only needs java-1.8.0-openjdk-headless
Summary: libreoffice drags in java-1.8.0-openjdk, but it only needs java-1.8.0-openjdk...
Alias: None
Product: Fedora
Classification: Fedora
Component: libreoffice
Version: 21
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Caolan McNamara
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-08-19 09:08 UTC by Elad Alfassa
Modified: 2015-09-12 17:30 UTC (History)
7 users (show)

Fixed In Version: libreoffice-
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-28 19:52:02 UTC
Type: Bug

Attachments (Terms of Use)

Description Elad Alfassa 2014-08-19 09:08:02 UTC
libreoffice doesn't use anything in the java-1.8.0-openjdk package, it only needs the java-1.8.0-openjdk-headless package.

However, it drags in java-1.8.0-openjdk which clutters the desktop app view with two useless icons. 

This is not acceptable for Fedora Workstation's default install.

Please fix the dependency to pull in the headless package only.

See bug #1131245 for more info.

Comment 1 Caolan McNamara 2014-08-19 11:13:22 UTC
I wonder did we try java-headless as a dependency before. Lets give it a shot anyway.

(Its possible we might end up pulling in the whole stack again via some dependency that requires it, so if this doesn't work, check what the remaining dependency chain)

Comment 2 David Tardon 2014-08-19 12:35:47 UTC
(In reply to Caolan McNamara from comment #1)
> I wonder did we try java-headless as a dependency before. Lets give it a
> shot anyway.

We already rejected that idea once, see bug 1068364.

Comment 3 Elad Alfassa 2014-08-19 12:57:04 UTC
This is a huge problem for Fedora Workstation... the regular (non headless) Java package pulls in launchers we don't want to have in our default install because they make the product look bad and unpolished, and the java maintainers won't separate them to a subpackage.

Comment 4 Caolan McNamara 2014-08-19 13:01:04 UTC
So *we* don't directly need awt though optional extra extensions might. If the extensions are packaged as rpms then they can require that, and if they are manual added then maybe the problem becomes some magically problem of package-kit to prompt to install the non-headless version :-)

Comment 5 Elad Alfassa 2014-08-21 11:29:41 UTC
Still a problem.

libjawt.so is in the non headless package and libreoffice-core depends on it :(

Comment 6 Caolan McNamara 2014-08-21 11:33:38 UTC
aha, that's why we didn't have this before, we need libjawt for libofficebean.so

Comment 7 Caolan McNamara 2014-08-21 12:32:22 UTC
opensuse splits libofficebean.so into a libreoffice-officebean subpackage

Comment 8 Stephan Bergmann 2014-08-21 12:44:31 UTC
...but that still leaves the problem that (non-RPM-packaged) LO extensions can require non-headless Java and expect LO to provide that

Comment 9 Caolan McNamara 2014-08-21 13:02:38 UTC
in upstream mode we don't ship with any java or have dependencies that would pull it it automatically so there's a certain degree of precedence there. I mean if someone just installed the vanilla libreoffice they won't get non headless java pulled in.

I wonder if its possible to tell that an extension the non-headless java pieces that are not installed although the reset of java is installed because we have a package-kit service of SyncDBusSessionHelper which we could use to prompt for the installation of the missing pieces.

Comment 10 Michael Stahl 2014-08-21 13:27:48 UTC
if you go to Tools->Macros->Organize->JavaScript (or BeanShell)
you get some Java Swing dialogs.

not sure how we package those things.

Comment 11 David Tardon 2014-08-21 15:08:28 UTC
BeanShell scripts are in subpackage libreoffice-bsh, JavaScript ones in libreoffice-rhino.

Comment 12 Elad Alfassa 2014-08-22 14:41:37 UTC
Thanks for working on this.

Comment 13 Elad Alfassa 2014-08-26 12:38:13 UTC
I've saw you made a commit which says it resolves this issue. It *almost* does.
Now libreoffice-ure is what pulls in the non headless java

from a verbose yum output:

1:libreoffice-ure- requires: jre >= 1.5.0
Searching pkgSack for dep: jre
TSINFO: Marking 1:java-1.8.0-openjdk- as install for 1:libreoffice-ure-

I assume the fix for this would be changing the Requires tag of the ure supbackage from jre to jre-headless

Again thanks for working on this.

Comment 14 Elad Alfassa 2014-08-28 19:52:02 UTC
Seems that the latest version of the libreoffice apps we install by default on Workstation (Writer, Calc, Impress, Draw) no longer pull in the non-headless Java. Thanks again for working on this!

I'm closing this bug as fixed, because from my perspective it is.

Comment 15 Christian Stadelmann 2015-09-12 17:30:15 UTC
I want to second comment #8.(In reply to Stephan Bergmann from comment #8)
> ...but that still leaves the problem that (non-RPM-packaged) LO extensions
> can require non-headless Java and expect LO to provide that

This ist still true. It e.g. breaks the LanguageTool extension [1]. Since the LanguageTool extension is not doing something wrong (using Swing from extensions is fine), LibreOffice or the packaging is.

I think LibreOffice needs to extend its Extension API to add a field in which the extension can tell that it requires Java+Swing (i.e. the non-headless java). Maybe this should be moved upstream.
As a workaround those extensions could check for themselves, but this is no good way to solve this problem IMHO.

[1] https://languagetool.org/issues/ , search for "headless"

Note You need to log in before you can comment on or make changes to this bug.