I'm developing a command line java app that must run a program called gradlew.bat assembleRelease
inside this directory: this.workDir+"/Project/CapAndroid"
So i did this:
Process p = Runtime.getRuntime().exec("gradlew.bat assembleRelease", null , new File(this.workDir+"/Project/CapAndroid"));
The file is in that directory 100% sure and it works perfect in linux but did not work on Windows! I got this error:
java.io.IOException: Cannot run program "gradlew.bat" (in directory "C:\Users\Administrador\Desktop\generators\And\jobs\2247994\Project\CapAndroid"): CreateProcess error=2, The system cannot find the file specified
I think windows has a problem to know that the command passed in the first parameter of exec() method must be executed in the directory passed in the last parameter. Linux works perfect, also OS X too, the problem is only in Windows
Thanks a lot