It's all about the answers!

Ask a question

How do I set environment variable in a build definition properties tab before running my build?


Frank Brewer (547) | asked Mar 30 '14, 2:24 p.m.

I went to the properties tab in the build definiton and set five enviornment variables here.  My build failed because it could not find my JAVA_HOME environment variable.  However, I thought I had set that correctoly in the properties tab.  Here is what I did:

Name:  JAVA_HOME

Value: C:\projectA\spin16\java7\jdkl1.7.0_25

Any suggestions as to how to set an enviornment variable using the build definition properties tab?

Thanks.

Accepted answer


permanent link
Spencer Murata (2.3k115971) | answered Mar 31 '14, 4:17 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
 Just because the property is passed to the build engine does not mean that the command will pick it up.  Did you explicitly add that variable to the command you are running?  The JBE will automatically add properties to an Ant script, but it sounds like you need it to be part of the initial program execution which would have to be done explicitly.

~Spencer
Frank Brewer selected this answer as the correct answer

Comments
Frank Brewer commented Mar 31 '14, 4:37 p.m.

Basically, I cd to where the build.xml is located and run an "ant target" command.  I expected the environment variables that I defined in the properties tab to be used by my build initiated by the "ant target" command.  That apparently does not happen.  I am not sure how to use an Ant script.  Is there a way to enter environment variables into such a script that the build uses when it kicks off?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.