I am trying to call my linux executable from a shell script. Before calling this executable, I want to set LD_LIBRARY_PATH with specific values. My shell script looks like this:
Parent.sh (contains 2 lines)
- source set_env.sh
- executable.so
Set_env.sh
- setenv LD_LIBRARY_PATH /proj/something
When you manually run the Parent.sh script from the linux console, executable.so is called with LD_LIBRARY_PATH set correctly. But after integration with java code:
String[] commandArray ={"Parent.sh"};
Runtime runtime = Runtime.getRuntime();
Process javap = runtime.exec(commandArray);
javap.waitFor();
LD_LIBRARY_PATH is not set for executable.so
I hope that the description is clear :)
Please report what is wrong with the code.
source
share