java中如何调用系统的计算器程序

解决方案 »

  1.   

    public   class   CalculatorCaller{   
              public   static   void   main(String[]   args)   throws   Exception{   
                      String  path="系统计算器的路径";   
                      Runtime   runTime   =   Runtime.getRuntime();   
                      runTime.exec("cmd   /c   start   "   +   f);   
              }   
      }我用的Windows 7,计算器的路径在C:/WINDOWS/system32/cal.exe试试看行不
      

  2.   


    不好意思,上面+f不知道怎么写错了,应该是+path
      

  3.   

    Runtime.getRuntime().exec(String arg)
    参数是url
      

  4.   

    class Calc{   
    public static void main(String[] args) throws Exception{  
    Runtime.getRuntime().exec("cmd /c start C:\\WINDOWS\\system32\\calc.exe");   
    }   
    }