路过" -J-Duser.language"到通过蚂蚁的javac,以确保编译错误报告正确的语言 [英] Passing "-J-Duser.language" into javac through ant to ensure compilation errors are reported in the correct language
问题描述
我的电脑目前设置为日本用于测试目的。如果我的Java项目都有一个编译错误报道日本的消息。
My PC is currently set up as Japanese for testing purposes. If my java project has a compilation error the message is reported in Japanese.
例如。
将源文件编译为[...目录...]
[... ...类]的java:172:シンボルを见つけられません
e.g. Compiling 1 source file to [...directory...] [...class...].java:172: シンボルを見つけられません。
我想preFER看到英文的错误。
I would prefer to see the errors in english.
如果不使用蚂蚁这种情况的解决方法是使用
javac的-J-Duser.language = EN [..java文件...]
这使得javac的提供英语错误消息(的-J告诉javac的传递参数的java的其余部分)
Without using ant the fix for this is to use javac -J-Duser.language=en [..java files...] which makes javac give english error messages (the -J tells javac to pass the rest of the argument to java)
我的问题是:我怎么把它传递给蚂蚁
[editted删除我试过选项没有工作]
My question is: how do I pass this to ant [editted to remove options I tried that didn't work]
推荐答案
尝试添加< compilerarg>
你的< javac的>
电话。例如:
Try adding a <compilerarg>
to your <javac>
call. For example:
<javac srcdir="${src.dir}" destdir="${classes.dir}" fork="true">
<compilerarg value="-J-Duser.language=en"/>
<compilerarg value="-J-Duser.country=GB"/>
</javac>
修改修正了的arg值。此外,如果编译器叉形这仅适用;我更新的例子来反映这一点。
EDIT Fixed the arg values. Also, this only works if the compiler is forked; I updated the example to reflect that.
这篇关于路过&QUOT; -J-Duser.language&QUOT;到通过蚂蚁的javac,以确保编译错误报告正确的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!