I ran into issues such that the PATH system is not a Java process. To debug this, you can print out what the Java process sees as the env variable of the path using:
EnvironmentUtils.getProcEnvironment();
Which will give you a map, and you can see if Java can see the path variable. If this does not happen, then the next step is to find out why you cannot see it.
If it is, I will try to run the excutor.execute command as follows:
int exitValue = executor.execute(commandLine, EnvironmentUtils.getProcEnvironment());
source share