java Runtime.exec to run shell script - cannot open file

后端 未结 4 1988
悲&欢浪女
悲&欢浪女 2020-12-18 14:51

I am using Runtime.getRuntime().exec() to run a shell script from java code.

    String[] cmd = {\"sh\",  \"build.sh\", \"/Path/to my/sh file\"};
    try{
           


        
4条回答
  •  无人及你
    2020-12-18 15:34

    sh is unable to find the build.sh script. To fix this you can provide the full path to build.sh.

提交回复
热议问题