I tried setting the Path variable in ant exec task using this link. But its not working somehow. I am trying to add THRIFT_HOME which is set to basedir currently and I have the thrift.exe file in the basedir.
Also, when I change executable attribute value to thrift.exe, the thrift compiler works properly but the basedir is not added to the Path.
<exec executable="thrift">
<env key="Path" value="${env.Path};${THRIFT_HOME}" />
</exec>
I also tried using the setx command as:
<exec executable="setx">
<arg value="Path"/>
<arg value="%Path%;${THRIFT_HOME}"/>
</exec>
but it still does not work.
Any help would be appreciated!
I am currently using on Windows 7 and the problem was with spaces in the folder name. That’s a big problem when working on Windows.
I tried placing the thrift executable at
/d/thrift/and it worked and assigningTHRIFT_HOME = /d/thrift. Then I tried/d/thrift demo/and there is the problem.Another problem is that
/d/thriftdoesn’t work inEclipse Ant plugin build. I tried it using command prompt and the build was successful.This teaches a new lesson: Always build from command prompt!
Thanks to all who answered for this question.