问题遇到的现象和发生背景
在 docker 中空指针,直接部署在 linux 中不会,在docker 容器中执行 free -m 可正常输出,怎么回事呢
String newCmd = "free -m";
String arr = null;
try {
Process process = Runtime.getRuntime().exec(new String[]{"bash", "-c", newCmd});
arr = loadStream(process.getInputStream());
} catch (IOException e) {
e.printStackTrace();
}