Eclipse not reading ANT env variables

Sometimes you have ANT build.xml that works perfectly from command line but does not execute in Eclipse:

BUILD FAILED
Execute failed: java.io.IOException: Cannot run program "${env.THRIFT_TOOL}": error=2, No such file or directory

When you inspect your build.xml you should have (true for any executable):

<property environment="env"/><property name="thrift.compiler" value="${env.THRIFT_TOOL}"/>


If you inspect your env variable setting, on OSX ~/.profile you should have:

# Thrift tool  - updated: Sept 16, 2014
export THRIFT_TOOL=/usr/local/bin/thrift
export PATH=${THRIFT_TOOL}:${PATH}


Yet Eclipse is not running Ant correctly!

Starting Eclipse from COMMAND LINE fixes the issue:

$ bash -ic /Applications/../Eclipse.app/Contents/MacOS/eclipse 



As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles