CreateProcess error=2, The system cannot find the file specified

前端 未结 5 954
既然无缘
既然无缘 2020-11-29 04:58

I am writing a program in java which would execute winrar and unzip a jar file for me placed in h:\\myjar.jar into the folder h:\\new. My java code

5条回答
  •  情话喂你
    2020-11-29 05:02

    The complete first argument of exec is being interpreted as the executable. Use

    p = rt.exec(new String[] {"winrar.exe", "x", "h:\\myjar.jar", "*.*", "h:\\new" }
                null, 
                dir);
    

提交回复
热议问题