Ant ignores attempt to override the LANG environment variable

Posted by Steen on Stack Overflow See other posts from Stack Overflow or by Steen
Published on 2010-05-20T10:16:14Z Indexed on 2010/05/20 10:20 UTC
Read the original article Hit count: 342

Filed under:
|
|
|

We need to test a java build with the languages set to different values. I can manually (i.e. via export LANG=en_DK.UTF-8 and export LANG=en_DK) test that the unit tests run with the ant build script behaves differently, but I need to set the environment variable from ant. I have tried setting it using these methods (with the shell $LANG set to en_DK.UTF-8):

  1. using -D on the command line: ant -DLANG=en_DK
  2. using a build.properties file with the line LANG=en_DK in it
  3. using the following statements in the build.xml file (sorry for the formatting, I can't get SO to display it otherwise):

:

<property environment="ANTENV"/>
<property name="ANTENV.LANG" value="en_DK"/>

Using any of the three possibilities, and when run with -debug, ant reports that:

Override ignored for property "LANG"

What can I do to set the LANG environment variable from within ant?

© Stack Overflow or respective owner

Related posts about ant

Related posts about java