使用ant 的exec时不能随意省略可执行文件的扩展名
来源:互联网 发布:政治学 知乎 编辑:程序博客网 时间:2024/06/02 16:12
我原来这样写:
<exec dir="${another.project}" executable="ant">
</exec>
结果:Execute failed: java.io.IOException: CreateProcess: ant error=2
后来把 executable="ant" 改成 executable="ant.bat" 就成功了
官方文档这样说:
Windows Users
The <exec>
task delegates to Runtime.exec
which in turn apparently calls ::CreateProcess
. It is the latter Win32 function that defines the exact semantics of the call. In particular, if you do not put a file extension on the executable, only ".EXE" files are looked for, not ".COM", ".CMD" or other file types listed in the environment variable PATHEXT. That is only used by the shell.
Note that .bat files cannot in general by executed directly. One normally needs to execute the command shell executable cmd
using the /c
switch.
<target name="help"> <exec executable="cmd"> <arg value="/c"/> <arg value="ant.bat"/> <arg value="-p"/> </exec></target>
- 使用ant 的exec时不能随意省略可执行文件的扩展名
- 可执行文件不能运行的解决方法
- 服务器控件之间不能随意的嵌套
- 服务器控件之间不能随意的嵌套
- Runtime.exec()的使用
- Runtime.exec()的使用
- EXEC的使用
- Runtime.exec()的使用
- Runtime.exec()的使用
- exec函数的使用
- exec函数的使用
- exec命令的使用
- 使用ant的exec命令来调用 make命令执行makefile文件
- ant使用exec执行shell
- INSERT EXEC PROC不能嵌套的解决方法
- 【ant】升级Android SDK后ant打包不能使用的问题
- Ant学习总结(1)对exec的理解
- basedir="."表示当前路径,可以省略,在myeclipse中ant是可以调试的
- 中国程序员如何表达感情
- VC中使用GIF格式图片美化界面
- vc计算磁盘大小的方法
- 对Windows 2000中wkssvc.dll中某个函数的分析
- AgileChina 2007年度首次联合聚会活动
- 使用ant 的exec时不能随意省略可执行文件的扩展名
- QQ、MSN签名精选
- 她结婚了?
- SAP-MM模块学习
- VC++ 2005编译出程序在XP下执行出错的解决方法
- 终于可以在emacs里面用五笔输入中文了
- spring的功能特点
- 一个小的服务器的探针程序(ASP)
- 原来金嗓子的恶心广告是非法的