Hi Kent,

Great! You found a solution!

I had the same problem recently with a project at work.
In my build.xml, I have the following to make it work:

<env key="PATH" 
path="${env.PATH}:${cto7.home}/Plugin/FacetTfm/carat_sharp/init"/>

where:
${env.PATH}      is what is currently in my system path variable
${cto7.home}/Plugin/FacetTfm/carat_sharp/init     is the path I want to add.

This method avoids setting any system variables outside of the build.xml file 
regardless of the platform I am using.

--Anna

-----Original message-----
From: "Kent Larsson" [email protected]
Date: Thu, 15 Jan 2009 12:36:39 -0500
To: "Ant Users List" [email protected]
Subject: Re: <property environment=”env”> doe sn't pick up an environment 
variable

> Hi again,
> 
> It is solved now. I run Ubuntu and had defined CATALINA_HOME in
> etc/environment to get a system wide environment variable. I then used .
> /etc/environment to load the variable into the bash instance I used. Somehow
> ant could not pick up on this variable until after I rebooted. I'm sure
> there is some way to load it in, I'm just not proficient enough with Linux.
> 
> Best regards, Kent
> 
> 
> On Thu, Jan 15, 2009 at 5:25 PM, Kent Larsson <[email protected]>wrote:
> 
> > Hi, I have a build.xml for my Ant build script and a build.properties file
> > for easier configuration.
> >
> >    $   ls build.*
> >    -rw-r--r-- 1 tnek tnek  29 2009-01-15 17:01 build.properties
> >    -rw-r--r-- 1 tnek tnek 270 2009-01-15 17:05 build.xml
> >
> > They are short and easy to understand:
> >
> >    $   cat build.properties
> >    # Some comment
> >    hello=jejejej
> >    $   cat build.xml
> >    <?xml version="1.0"?>
> >    <project xmlns:ivy="antlib:org.apache.ivy.ant" name="testproject">
> >            <property environment="env"/>
> >            <property file="build.properties"/>
> >            <echo message="hello = ${hello} and env.CATALINA_HOME =
> > ${env.CATALINA_HOME} and path = ${env.PATH}"/>
> >    </project>
> >
> > The environment variable CATALINA_HOME is defined:
> >
> >    $   echo $CATALINA_HOME
> >    /var/lib/tomcat5.5
> >
> > Still only the environment variable PATH is echoed as it's supposed to:
> >
> >    $   ant -v
> >    Apache Ant version 1.7.0 compiled on August 29 2007
> >    Buildfile: build.xml
> >    Detected Java version: 1.6 in: /usr/lib/jvm/java-6-sun-1.6.0.07/jre
> >    Detected OS: Linux
> >    parsing buildfile /home/tnek/testproject/build.xml with URI =
> > file:/home/tnek/testproject/build.xml
> >    Project base dir set to: /home/tnek/testproject
> >    [antlib:org.apache.tools.ant] Could not load definitions from resource
> > org/apache/tools/ant/antlib.xml. It could not be found.
> >     [property] Loading Environment env.
> >     [property] Loading /home/tnek/testproject/build.properties
> >    Property "env.CATALINA_HOME" has not been set
> >         [echo] hello = jejejej and env.CATALINA_HOME = ${env.CATALINA_HOME}
> > and path =
> > /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> >
> >    BUILD SUCCESSFUL
> >    Total time: 0 seconds
> >
> > Why isn't CATALINA_HOME echoed and how can I fix it?
> >
> 
> 

__________________________________________________________________________
This message and all attachments are PRIVATE, and contain information that
is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to
transmit or otherwise disclose this message or any attachments to any
third party whatsoever without the express written consent of Intelligent
Automation, Inc. If you received this message in error or you are not
willing to view this message or any attachments on a confidential basis,
please immediately delete this email and any attachments and notify
Intelligent Automation, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to