We are using a beam multi-language pipeline using python and java(ref https://beam.apache.org/documentation/sdks/python-multi-language-pipelines/). We are creating a cross-language pipeline using java. We have some external jar files that required a java library path. Code gets compiled properly and is able to create a jar file. When I run the jar file it creates a Grpc server but when I use the python pipeline to call External transform it is not picking up the java library path it picks the default java library path.

Tried -Djava.library.path=<path_to_dll> while running jar file. Tried System.setProperty(“java.library.path”, “/path/to/library”). (Ref https://examples.javacodegeeks.com/java-library-path-what-is-java-library-and-how-to-use/)
Tried JvmInitializer of beam to overwrite system property. (Ref https://examples.javacodegeeks.com/java-library-path-what-is-java-library-and-how-to-use/)
Tried to pull code beam open source and tried to overwrite system proprty before expansion starts. It overwrite but it is not picking correct java path when calls using python external transform. (ref https://github.com/apache/beam/blob/master/sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionService.java)