Re: Can Ant use existing environment variables?

Discussion in 'Java' started by Phil Hanna, Jul 1, 2003.

  1. Phil Hanna

    Phil Hanna Guest

    On Fri, 27 Jun 2003 07:36:41 +0100, David Potts <>
    wrote:

    >Wendy S wrote:
    >> In build.xml, I have:
    >>
    >> <property name="tomcat" value="c:\jakarta\jakarta-tomcat-4.1.24" />
    >> and
    >> <path id="project.classpath">
    >> <pathelement location="${tomcat}\common\lib\servlet.jar" />
    >> </path>
    >>
    >> Is there a way to get it to pick up %TOMCAT_HOME% on Windows?
    >>

    >
    >
    >
    >Yup. You declare a prefix (e.g. "env") with a property tag and can then
    >reference environment variables by e.g. $(env.TOMCAT_HOME}.


    Specifically,

    <property environment="env"/>
    <property name="tomcat" value="${env.TOMCAT_HOME}"/>

    --
    Phil Hanna
    Author of JSP 2.0: The Complete Reference
    http://www.philhanna.com
    http://www.philhanna.com
    Phil Hanna, Jul 1, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Bedford
    Replies:
    6
    Views:
    2,205
  2. Ulf Meinhardt
    Replies:
    0
    Views:
    556
    Ulf Meinhardt
    Oct 13, 2004
  3. john martin
    Replies:
    2
    Views:
    2,197
    john martin
    Apr 7, 2005
  4. Replies:
    1
    Views:
    479
    Larry
    Mar 7, 2006
  5. naveenduttvyas
    Replies:
    0
    Views:
    1,684
    naveenduttvyas
    Oct 9, 2008
Loading...

Share This Page