I want to have English messages when compiling.
Following this post and this, I added the following to my build.gradle
compileJava {
options.compilerArgs << '-J-Duser.language=en'
options.fork = true
options.forkOptions.executable = 'javac'
}
But I get ([] is my translation, not official)
javac: 无效的标记[invalid flags]: -J-Duser.language=en
用法[usage]: javac <options> <source files>
-help 用于列出可能的选项[for possible options]
In cmd
, a simple javac -J-Duser.language=en
do gives me English messages.
My question:
- What am I doing wrong?
- How can I make gradle show the exact
javac
command used when compiling?