Ant can't find a executable in the Windows path

大兔子大兔子 提交于 2019-12-10 21:13:54

问题


I got a simple ant target :

<target name="doxygen">
    <exec executable="doxygen" dir="${basedir}/doxygen">
        <arg value="Doxyfile" />
    </exec>
</target>

I'm on Windows Seven. When i try the same command line ( doxygen Doxyfile ) in the Windows console, it works perfectly. The doxygen executable can by found because i added the good path in my PATH environment variable.

But ANT juste can't find the doxygen executable and i get the following error :

build.xml:83: Execute failed: java.io.IOException: Cannot run program "doxygen.exe" : CreateProcess error=2

How can i make ANT to use the Windows PATH environment variable ?

I already tried the searchpath property, but i don't works.


回答1:


You want to find where Doxygen is currently installed on your system. Then make a property with that value, so it can be overridden by people that installed doxygen somewhere else.

<property name="doxygen.path" location="C:\Program Files\Doxygen"/>

<target name="doxygen">
    <exec executable="${doxygen.path}/doxygen" dir="${basedir}/doxygen">
        <arg value="Doxyfile" />
    </exec>
</target>


来源:https://stackoverflow.com/questions/17088470/ant-cant-find-a-executable-in-the-windows-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!