I would like to set javac compile option as "-J-Duser.language=en" in gradle.
my question is pretty mach same as Here
so i tried following code:
project.tasks.withType(JavaCompile.class) {
options.fork = true
options.forkOptions.jvmArgs = ["-J-Duser.language=en"]
...
}
Then gradle return following error message
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unrecognized option: -J-Duser.language=en
I believe that I am doing something wrong. How can I change the output to English in gradle plugin?
ADD: I also tried following code
project.tasks.withType(JavaCompile.class) {
options.compilerArgs << '-J-Duser.language=en'
...
}
then, gradle returns this error code:
> Cannot specify -J flags via `CompileOptions.compilerArgs`.
Use the `CompileOptions.forkOptions.jvmArgs` property instead.