I have a bash script that runs fine from the terminal, but when I attempt to execute it from my Java program using ProcessBuilder it fails with TERM environment variable not set
:
ProcessBuilder pb = new ProcessBuilder( "./my_script", "my_param");
pb.redirectErrorStream(true);
pb.directory("../../");
Process p = pb.start();
...
There is a similar question here which reports the same problem when running a bash script, however in my case this only happens when I run it from Java ProcessBuilder. I am curious to understand why.
Thank you for your attention.