Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using exec tag in Ant from Eclipse. How do I extend the PATH?

Tags:

eclipse

ant

I am trying to exec git describe in ant from inside eclipse. I have the following inside one of my targets:

<exec  executable="git" outputproperty="git-desc">
    <arg value="describe"/>
</exec>

When I try this from command line, ant runs properly as it uses the PATH set by my shell. When I try to run ant from eclipse, I get the following error:

Cannot run program "git": error=2, No such file or directory

It seems pretty clear that I need to update the PATH that eclipse is given. How do I go about doing this?

like image 953
Chris J Avatar asked Jul 07 '10 04:07

Chris J


1 Answers

I actually figured this one out on my own. You have to set the PATH environment variable for ant in eclipse.

Step 1: Go to Run->External Tools->External Tools Configurations...

Step 2: Select the ant file you want to run that is trying to execute a command line program

Step 3: Click the Environment tab

Step 4: Click the New button to add a new variable

Step 5: Create a variable named PATH and enter in the paths that you want delimited by :

like image 73
Chris J Avatar answered Nov 16 '22 01:11

Chris J