用本地方法,可以看看java 核心技术II的最后一章

解决方案 »

  1.   

    这是一个简单的Test.java,功能比较的简单。如果要从事较复杂的功能的话,
    请参考JAVA的类库。
    Sample:
    import java.io.*;public class Test {   public static void main(String[] command) {      if(command.length != 1) {
             System.out.println("请输入运行文件的文件名");
             System.exit(0);
          }      try {
             Process proc = Runtime.getRuntime().exec(command[0]);
             BufferedReader in = new BufferedReader(
                new InputStreamReader(proc.getInputStream()));
             String text = null;
             while((text = in.readLine()) != null) {
                 System.out.println(text);
             }
          }
          catch(IOException ioError) {
             ioError.printStackTrace();
             System.exit(0);
          }   }
    }
      

  2.   

    请问hello_wyq(hobby):怎样取得执行后的结果?
      

  3.   

    回复okin() 
    没有办法得到运行结果