在Java中,可以通过使用Runtime类或ProcessBuilder类来调用shell命令。 使用Runtime类: String command = "ls -l"; // 要执行的shell命令 Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec(command); 复制代码 使用ProcessBuilder类: String command = "ls -l"; // 要执行的shell...