Friday, October 06, 2006

在java程序中执行其他程序或dos命令

import java.io.*;
public class Test{
public static void main(String[] args){
try{
Runtime.getRuntime().exec("cmd.exe /c start javac Test2.java");
} catch(Exception e){
e.printStackTrace();
}
}
}

Labels:


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?