External tools like JabRef  support integrating with LibreOffice . However, this is broken when LibreOffice is installed as a Flatpak, the first problem surfacing being that the LibreOffice Flatpak does not include the necessary JARs . There might be follow up problems regarding to namespaces, but I did not investigate that far, yet.
I don't know which JARs exactly you are talking about.
Due to Flatpak's sandboxed nature, it can be difficult to access an app's special-purpose interfaces (like LO's Java UNO interface) from the outside.
(In reply to Stephan Bergmann from comment #1)
> I don't know which JARs exactly you are talking about.
Christoph Siedler (JabRef) says that the following JARs are needed:
> Due to Flatpak's sandboxed nature, it can be difficult to access an app's
> special-purpose interfaces (like LO's Java UNO interface) from the outside.
Given the list of JARs above: What would be necessary changes to Flatpak, to support this?
As a next step, I would open a feature request for Flatpak (or reference one that already exists, if I find one), asking for those changes to Flatpak.
@Stephan Bergmann, Please see comment 2
When external (C++ or Java) programs want to communicate with LO via the UNO Remote Protocol (URP), those programs need access to certain libraries (C++ dynamic libraries or Java jars, resp.) and helper data and code files (e.g., even in the case of Java jars, these reference native code that is implemented in helper native dynamic libraries; see <https://wiki.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide> for details on all this).
LO includes all these files, so one way of obtaining access to those files is to ask the LO installation that the external program wants to target about the location of those files. This is done with the unoinfo helper executable (see desktop/README.md for details). However, in the case of flatpak, something like `flatpak run --command=/app/libreoffice/program/unoinfo org.libreoffice.LibreOffice java` isn't useful to a program outside the LO flatpak sandbox, as the reported paths don't exist outside that flatpak. So, to make that work, some way of accessing a flatpak's arbitrary data and code files from outside the flatpak would be necessary, and some mechanism by which the paths that unoinfo reports can be mapped from flatpak-internal to flatpak-external paths.
However, URP and the software artefacts necessary to speak it are evolved compatibly, so it generally works to make an external program use such files that don't come from the targeted LO installation, but rather from a different source. There has been such a standalone UNO Runtime Environment (URE) in the past, but it has been abandoned for lack of maintenance support (though its traces and concepts are still there in the code, and e.g. some Linux distros still maintain it as a separate LO sub-package). Such a URE running outside the flatpak (and potentially bundled with the external program) would be an alternative approach to solve this issue.