java运行脚本语言demo

public class Test {


/**
* @param args
* @throws IOException 
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Process  process = Runtime.getRuntime().exec("cmd");
InputStream is = process.getInputStream();

BufferedReader br = new BufferedReader(new InputStreamReader(is));

String line ;


while((line = br.readLine())!=null)
System.out.println(line);
}


}
posted @ 2016-01-24 09:25  lcchuguo  阅读(239)  评论(0编辑  收藏  举报