0
点赞
收藏
分享

微信扫一扫

Java运行外部程序-_-!...


// 几行代码我就不解释啦!

import  java.lang.Runtime;
import java.io.IOException;

public class runCmd {

public static void main(String[] args) {
try{
Runtime.getRuntime().exec("cmd.exe /c start cmd.exe");
}
catch(IOException e){
System.out.println("运行cmd程序时出现错误!\n"+e.toString());
}
System.out.println("Hello World!");
}
}


举报

相关推荐

0 条评论