Eclipse – Can Eclipse not hard-code ECLIPSE_HOME when exporting build.xml

anteclipse

I have an Eclipse project that I'm attempting to set up to build both with Eclipse and externally with Ant. It seems like a good way to do this is to have Eclipse generate a build.xml file that I can then use with ant.

I'd like to set it up so the build.xml can be regenerated from Eclipse whenever the need arises, which means no hand-editing the build.xml file. But Eclipse writes one entry in there that has a hard-coded path to a directory on my computer, which makes it unsuitable for checking in to a source repository.

Specifically it's this entry that's the trouble:

<property name="ECLIPSE_HOME" value="D:/Eclipse/Eclipse Galileo (3.5) SR1"/>

Is there some way to have Eclipse not output this line, or to make it a relative reference or something that makes sense to check in?

Best Answer

Alternatively, due to Ant's immutable properties, you can override the value of ECLIPSE_HOME on the command line:

ant -DECLIPSE_HOME=c:/Eclipse/MyEclipseVersion build