Bug 127557 - Cannot use the UNO jars to connect to Libre Office from a modularized java 11 project
Summary: Cannot use the UNO jars to connect to Libre Office from a modularized java 11...
Status: RESOLVED DUPLICATE of bug 117331
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
6.3.1.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks:
 
Reported: 2019-09-15 13:58 UTC by Christoph
Modified: 2020-06-05 05:25 UTC (History)
6 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 Christoph 2019-09-15 13:58:23 UTC
Description:
When trying to connect to LibreOffice from a modularized (jigsaw) java 11 application, it is not possible to connect to Libre Office because the jars are included as dependencies on the module path.
It will result in "no office executable found!". Known problem.

Trying to load the jars dynamically e.g like this way, https://stackoverflow.com/a/48323948 it will result in an  exception, because the jars are a) on the module path already and b) in the unnamed module.

The workaround was to "hack" the Bootstrap to accept an URLClassLoader and to use sockets instead of pipe.
UrlClassLoader as parameter fixed the instantiation of the Boostrap,but then it complained about jpipe not on the library path. Even putting it on the PATH doesn't work either.



https://github.com/JabRef/jabref/blob/master/src/main/java/org/jabref/gui/openoffice/Bootstrap.java

Note that to include the jars in the module path also refers to Bug 117331













Steps to Reproduce:
1. Try to connect from a modularized java 11 application
2. Create a single jar out of the libs, put in module path
3. Try to load jars from LO program folder dynamically.


Actual Results:
You will encounter an exception

Expected Results:
Creating a successful connection.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Julien Nabet 2019-09-15 16:41:07 UTC
Stephan: thought you might be interested in this one since it concerns Java and UNO.
Comment 2 Samuel Mehrbrodt (allotropia) 2020-06-05 05:25:59 UTC

*** This bug has been marked as a duplicate of bug 117331 ***