Page 1 of 1

Set environment variables during Ant build or at runtime?

PostPosted: Wed Nov 04, 2020 11:33 pm
by johnrdorazio
I have successfully included the JCEF component into my AOO plugin, at least on Windows.
When trying to build for Linux (the JCEF component has differentiated builds for different platforms) I'm not having as much success.
Studying the sample application provided with the JCEF component, it seems that on Linux the LD_LIBRARY_PATH environment variable needs to include the path to the JCEF native libraries. I tried, for testing purposes, setting the LD_LIBRARY_PATH environment variable in my Ubuntu instance before launching the Debug build of the plugin, but upon inspection of the environment variables at runtime I see that the LD_LIBRARY_PATH environment variable is completely overwritten. I'm guessing it's the Ant build doing that: inspecting build-uno-impl.xml I see three references to LD_LIBRARY_PATH:

Code: Select all   Expand viewCollapse view
<env key="LD_LIBRARY_PATH" path="${office.tool.path}"/>


I really don't know much about Ant and I can't find where office.tool.path is defined, I don't see it anywhere else in the build.xml or build-uno-impl.xml and I don't see it in any properties files... I tried manually adding ":/path/to/jecf/native/libraries" after ${office.tool.path} in build-uno-impl.xml but that doesn't seem to change anything, at runtime I'm still seeing that the LD_LIBRARY_PATH environment variable doesn't have a reference to the JCEF native libraries. And I haven't found a way to change the value of environment variables at runtime in JDK 11 (I need to use JDK 11 because the JCEF build for Linux x64 was built using JDK 11, and using anything lower prevents the build).