读书人

java调用exe资料

发布时间: 2013-03-10 09:38:39 作者: rapoo

java调用exe文件

import java.io.IOException;


public class Te {

/**
* @param args
* @throws IOException
* @throws IOException
* @throws InterruptedException
*/
public static void main(String[] args) throws IOException, InterruptedException {
// TODO Auto-generated method stub
Process process = Runtime.getRuntime().exec("D:/1.exe");
process.waitFor( );
}
}

为什么调用1.exe的时候程序会卡到那里
[解决办法]
改为Process process = Runtime.getRuntime().exec("cmd /c start D:/1.exe");试试呢

读书人网 >Java相关

热点推荐