Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
就像标题中一样 - 我有一个进程(更具体的脚本路径池),我想使用单个可共享环境启动它。脚本将按顺序启动,每个实体都可能影响另一个实体的输入环境。当整个池被启动时,我想检索输出环境。
有任何想法吗?太棒了!
从 Java 运行进程时可以传递 env 变量
ProcessBuilder pb = new ProcessBuilder("myCommand"); Map<String, String> env = pb.environment(); env.put("VAR1", "myValue"); ...