Set environment variables during Ant build or at runtime?

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
johnrdorazio
Posts: 35
Joined: Sun Aug 17, 2014 2:04 pm
Location: Italy

Set environment variables during Ant build or at runtime?

Post 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

<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).
OpenOffice 4.1.6, NetBeans 8.1, Windows 10 x64 Home
Post Reply