我在IntelliJ IDEA (2019.2)中创建了本地Tomcat (8.5.15)运行配置。我正在运行Windows 10。当我试图运行配置时,我会得到错误:
Error running 'Local Tomcat': Cannot run program "C:\apache-tomcat-8.5.15\bin\catalina.bat" (in directory "C:\apache-tomcat-8.5.15\bin"): CreateProcess error=2, The system cannot find the file
声明,为了运行批处理文件,必须使用cmd.exe /C <path to bat>。实际上,它可以很好地运行批处理文件,除非脚本的路径包含空格(微软在的描述中确认了这一点)。我想知道是否有可能转义到批处理文件的路径中的空格,以使CreateProcess工作。添加引号没有帮助,CreateProcess失败时出错:
cannot spawn "<path to batch>": No such file or directory
更新
解决方法是使用@jac在注释中指出的短文件名。我仍然想知道为什么双引号中的路径对普通的可执行文件有效,而对批处理文件却不
失败:生成失败,出现异常。
出错原因:任务':app:preDexDebug‘执行失败。
java.io.IOException: Cannot run program "C:\Users\SETIAWAN\AppData\Local\Android\sdk\build-tools\21.1.2\dx.bat":
CreateProcess error=2, The system cannot find the file specified
Try: Run with --stacktrace option to get the stack trace. Run wi
Gradle exec:找不到windows上的命令
task runTest(type: Exec) {
workingDir "$buildDir/test"
commandLine 'test.bat'
}
错误:
Caused by: java.io.IOException: Cannot run program "test.bat" (in directory
"e:\foo\build\test"): CreateProcess error=2, The system cannot find the
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.4.2-bin.zip'.
org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':generateLockfiles'.
Could not create task '
我正在开发一个命令行java应用程序,它必须在这个目录下运行一个名为gradlew.bat assembleRelease的程序:this.workDir+"/Project/CapAndroid"
所以我做了这个:
Process p = Runtime.getRuntime().exec("gradlew.bat assembleRelease", null , new File(this.workDir+"/Project/CapAndroid"));
该文件在该目录中100%确定,它在linux中工作完美,但在Windows上不工作!我发
我试图从android studio执行SDK管理器,但是我得到了一个错误信息,说系统找不到指定的路径。
7:38:44 AM ProcessNotCreatedException: Cannot run program "C:\Program Files\Android\android sdk\tools\android.bat": CreateProcess error=2, The system cannot find the file specified: Cannot run program "C:\Program Files\Android\android