Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 84131 invoked by uid 500); 19 Oct 2001 06:15:29 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 84100 invoked from network); 19 Oct 2001 06:15:24 -0000 Message-ID: <3BCFF195.8C5FF007@home.com> Date: Fri, 19 Oct 2001 02:25:42 -0700 From: Phil Surette X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: ant-user@jakarta.apache.org Subject: Re: retrieve env vars thru ant References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ugh! Didn't notice that. Looking at the ant source it looks like this is ultimately because the Project class has a 'properties' member variable that is in fact a Hashtable! Too bad, cuz Properties objects are case-insensitive but hashes are not. Could the Property task doco be updated to mention the case-sensitivity under windows? Anyway, it's still a great feature! Conor MacNeill wrote: > > It is case sensitive and under Win2k, the Path is actually env.Path :-( > > > -----Original Message----- > > From: Phil Surette [mailto:philsurette@home.com] > > Sent: Friday, 19 October 2001 4:41 PM > > To: ant-user@jakarta.apache.org > > Subject: Re: retrieve env vars thru ant > > > > > > Since there is no way to get at environment variables from > > java, I was stunned to see that you could do it and ran > > off to create a test script. > > > > ...catch is it doesn't work under Windows 2000. > > > > > > > > > > > > > > path = ${env.PATH} > > test = ${test} > > > > > > > > output: > > Buildfile: build.xml > > > > echoenv: > > [echo] path = ${env.PATH} > > test = hello whirled > > > > BUILD SUCCESSFUL > > > > Total time: 2 seconds > > > > I guess Win2000 is not one of the 'select' platforms > > that the task works under... > > > > Steve Loughran wrote: > > > > > > ----- Original Message ----- > > > From: "Erik Hatcher" > > > To: > > > Sent: Thursday, October 18, 2001 09:06 > > > Subject: Re: retrieve env vars thru ant > > > > > > > As for JAVA_HOME, you can access it already with > > ${java.home}. (although > > > > it'll likely have "jre" appended to what the environment > > variable actually > > > > says.) > > > > > > I am not sure they are the same. JAVA_HOME usually points to > > the JDK base, > > > but java.home can refer to wherever the current JRE is, right? So if you > > > have the JDK but run off a JRE under Program Files then > > java.home can be a > > > long way from JAVA_HOME > > > > > > > For other environment variables, have a look at > > environment="..... > > > > /> > > > > > > > > > > that's what I use. > >