我正在尝试创建一个打开一些文本文件并写入消息的进程。但我的过程不能写;它只是打开文件:
Process pr = new ProcessBuilder("notepad","C:\\Users\\I\\Desktop\\1.txt").start();
OutputStream outputStream = pr.getOutputStream();
PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(outputStream));
printWriter.println("Process1");
printWriter.close();