你好,我在Linux centos 7上运行了两次Java代码,代码是:
ProcessBuilder pb = new ProcessBuilder(commandArr);
pb.redirectErrorStream(true);
Map<String, String> envs = pb.environment();
logger.info("In the process builder , the PATH is - " + envs.get("PATH"));
Process p = pb.start();
路径是
PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
那么下一次是
PATH=/usr/local/bin:/usr/bin
这种变化的来源是什么?