使用该语句的方法不能声明为 static . 如果不行,贴代码上来看。

解决方案 »

  1.   

    to wolfsquare:
       总归是要在main中调用的,而main是静态的,我也将这句换到类中,但还是这个错误
      

  2.   

    to skyyoung:
       编译出错啦
      

  3.   

    Runtime.getRuntime().exec("calc.exe");
    我刚才的贴子怎么没了?? 
      

  4.   

    Runtime.getRuntime().exec("calc.exe");
    我刚才的贴子怎么没了?? 
      

  5.   

    to Blue_Moon_
       可以说一下为什么出这个错吗?
      

  6.   

    exec is not a static function, so you cannot call Runtime.exec. Runtime.getRuntime() return an instance, It is equelent to Runtime rt = Runtime.getRuntime();
    rt.exec(...);
      

  7.   

    I use it in Unix 
    No error...and no result...Runtime.getRuntime().exec("HRts -I RAIN_hypo1.m  > test");
     
    HRts is my own program before,and test is output
      

  8.   

    there is no test file appear in the directoryand there is no error report either...faint la...>_<
    HELPS.O.S