4

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 Answer 1

4

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>
2
  • 1
    I accept your answer because this is what i have done. But the main problem was elsewhere. I start ANT form Eclipse, and when you do that, ANT just can't use your environment variables. If you try my code with ANT in the Windows console, it works perfectly.
    – Magus
    Jun 14, 2013 at 7:30
  • Try moving those from the system path to the user path and see if it works. I know that's not an answer either, but, I'm finding that eclipse seems to only pick up the "user path" and not the merged PATH. Still don't have a solution for it though, but maybe this is what you're running into.
    – tlum
    Sep 12, 2013 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.