ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Mackles <pa...@CNET.com>
Subject RE: using environment variables on Solaris
Date Tue, 14 Aug 2001 14:13:35 GMT
I got a similar error. Internally, ant uses /usr/bin/env on all unix platforms to get a listing
of all environment vars. The code in ant (v1.3) that parses the output from env barfs if any
environment variables contain embedded newlines.

> -----Original Message-----
> From: Anna Englund [mailto:anna.englund@accenture.com]
> Sent: Tuesday, August 14, 2001 10:03 AM
> To: ant-user@jakarta.apache.org
> Subject: using environment variables on Solaris
> 
> 
> Hi,
> 
> I'm trying to reach environment variables in my ant script 
> for Solaris.
> 
> The problem I'm having is that I get an 
> StringIndexOutOfBoundsException when ant loads the 
> environment variables. When I run the same script on Win2K 
> the environment variables are loaded just fine.
> 
> Any ideas?
> Would be very thankful for any help!
> //Anna
> 
> Basics: ant 1.3, ant-optional: 1.4 alpha, jdk 1.3.1
> 
> Script:
>   <property environment="env"/>
>   <echo message="HOME=${env.HOME}"/>
> 
> Output (in debug mode):
> ...
> Build sequence for target `init' is [init]
> Complete build sequence is [init, jsp, web-inf, javadoc, 
> clean, compile, buildejb, all]
> 
> init:
>  [property] Loading Environment env.
> 
> BUILD FAILED
> 
> /usr/local/wls/scripts/build.xml:30: 
> /usr/local/wls/scripts/build.xml:30: 
> java.lang.StringIndexOutOfBoundsException: String index out 
> of range: -1
> --- Nested Exception ---
> /usr/local/wls/scripts/build.xml:30: 
> java.lang.StringIndexOutOfBoundsException: String index out 
> of range: -1
> --- Nested Exception ---
> java.lang.StringIndexOutOfBoundsException: String index out 
> of range: -1
>         at java.lang.String.substring(String.java:1525)
>         at 
> org.apache.tools.ant.taskdefs.Property.loadEnvironment(Propert
> y.java:248)
>         at 
> org.apache.tools.ant.taskdefs.Property.execute(Property.java:172)
>         at org.apache.tools.ant.Target.execute(Target.java:153)
>         at org.apache.tools.ant.Project.runTarget(Project.java:898)
>         at 
> org.apache.tools.ant.Project.executeTarget(Project.java:536)
>         at 
> org.apache.tools.ant.Project.executeTargets(Project.java:510)
>         at org.apache.tools.ant.Main.runBuild(Main.java:421)
>         at org.apache.tools.ant.Main.main(Main.java:149)
> 
> 

Mime
View raw message