You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Juergen Damke <DA...@de.ibm.com> on 2001/08/03 17:40:04 UTC
call a JVM using different locales in one Build
I've problems using several locals in one build.
I create a master build.xml from which I call another xml file
with different locale definitions.
<ant antfile="${Wps.bld.dir}/build/SearchIndex.xml"
dir="${Wps.doc.dir}/en/InfoCenter"
target="BuildIndex">
<property name="InfoCenter.dir" value="
${Wps.doc.dir}/en/InfoCenter" />
<property name="Search.locale" value="en_US"/>
</ant>
<ant antfile="${Wps.bld.dir}/build/SearchIndex.xml"
dir="${Wps.doc.dir}/zh/InfoCenter"
target="BuildIndex">
<property name="InfoCenter.dir" value="
${Wps.doc.dir}/zh/InfoCenter" />
<property name="Search.locale" value="zh_CN"/>
</ant>
SearchIndex.xml contains the java call:
<java classname="com.sun.java.help.search.Indexer"
fork="yes">
<arg line="-locale ${Search.locale}"/>
<arg value="-verbose"/>
<arg line="-logfile ${Search.log}"/>
<classpath>
<pathelement location="${InfoCenter.dir}/"/>
<pathelement path="${Wps.srclib.dir}/jhall.jar"/>
</classpath>
<sysproperty key="LANG" value="${Search.locale}"/>
<sysproperty key="LC_ALL" value="${Search.locale}"/>
</java>
Problem is, that I do not know with which locale the JVM ist really
called. Even the -verbose Ant
parameter does not show that in the log.
>From the results the created chinese SearchIndex does not work and only
shows garbage
on an chinese system.
BTW: The build Machine is AIX 4.33 with all locales installed.
Ideas ?
Jürgen Damke
______________________________________________________________________
IBM EL ADS PvC Solutions 2, Dept 6547
URL: http://www-4.ibm.com/software/webservers/portal/
Re: call a JVM using different locales in one Build
Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 3 Aug 2001, Juergen Damke <DA...@de.ibm.com> wrote:
> <sysproperty key="LANG" value="${Search.locale}"/>
> <sysproperty key="LC_ALL" value="${Search.locale}"/>
This will set Java properties in the form -DLANG=${Search.locale}
which will probably not be what you want, you are looking for
environment variables.
Unfortunately <java> doesn't support setting environment variables,
even if invoked in forked mode, you'll have to fall back to the <exec>
task.
> Problem is, that I do not know with which locale the JVM ist really
> called. Even the -verbose Ant parameter does not show that in the
> log.
You should try -debug and look at some properties. In my environment
I get
Setting project property: user.timezone -> Europe/Berlin
Setting project property: user.language -> de
Setting project property: user.region -> DE
(you can as well <echo> them to avoid all the other stuff -debug
emits).
Stefan