ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Earl Hood <>
Subject Re: Specify source file language in build.xml?
Date Tue, 17 Feb 2015 21:26:39 GMT
On Tue, Feb 17, 2015 at 2:58 PM, Jeffrey Walton wrote:

>> Use the 'encoding' attribute to the <javac> task.
>             <javac encoding="${java.encoding}"
>                     source="${java.source}" target="${}"
>                     debug="true" extdirs="" includeantruntime="false"
>                     destdir="${out.classes.absolute.dir}"
>                     bootclasspathref=""
>                     verbose="${verbose}"
>                     classpathref="project.javac.classpath"
>                     fork="${need.javac.fork}">
>                 <src path="${source.absolute.dir}" />
>                 <src path="${gen.absolute.dir}" />
>                 <compilerarg line="${java.compilerargs}" />
>             </javac>

I do not know the specifics of how your build files are organized and if
you are using <ant> tasks to call other build files or you are including
all the build files so that targets are available directly.

With the fragment above, you need to set the java.encoding property.
You can do this from the command-line:

  ant -Djava.encoding=UTF-8 ...

Command-line property settings have the highest precedence and will
override any setting in the build files.

If you are using <ant> and/or <antcall>, both tasks allow you to
specify property settings for the target(s) you invoke (see the

>   <project>
>   ...
>     <property name="java.encoding" value="ascii" />
>   </project>

If you know the source files are using UTF-8, then use "UTF-8" as the

Note, java.encoding is not a default java system property, so something
is setting the property before the <javac> task is invoked.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message