Dependencies changed by PP Java component for JNI c++ method

We have a peculiar issue with a JNI shared object c++ library (linux) built into a java code. We are using this code within the Pipeline Pilot java components. The shared object is compiled with a newer version of c++ then the system default, but we managed to make this work with java outside Pipeline Pilot. In the pacakge.conf, we define the java part:


CLASSPATH \\\$(package)/lang/java/dist/myjar.jar

LIBRARYPATH \\\$(package)/lang/java/lib


The library in question which is used in JNI is the \\\$(package)/lang/java/lib/libMyLib.so, which has a dependency from the filesystem:

ldd \\\$(package)/lang/java/lib/libMyLib.so
libstdc++.so.6 => /gcc/v7.5.0.app/el7/lib64/libstdc++.so.6 (0x00002aaaaaee7000)

This works fine, when I execute the command from java standalone, but if I use the component from Pipeline Pilot, I have the impression that the dependencies are overwritten, I got an error message:

pkg:/package/lang/java/lib/libMyLib.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by pkg:/package/lang/java/lib/libMyLib.so)

So for some reason it searches the lib in /lib64, instead of /gcc/v7.5.0.app/el7/lib64. As you see, the /gcc dependency is not under the \\\$(package). Can you please help, what might be here the issue?