| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
en9
10年前发布

java执行系统cmd命令

class ExecCmd {      public static void main(String args[]) {          Runtime run = Runtime.getRuntime();          Process process = null;          try {              process = run.exec("notepad"); // 执行cmd命令              process.waitFor();          } catch (Exception e) {              System.out.println("Error executing notepad.");          }          System.out.println("Notepad returned " + process.exitValue());      }  }