I need to set -Dfile.encoding=UTF8 globally on Windows machine.
I tried to set JAVA_OPTS environment variable in My Computer -> Properties ->Environment Variables and also via Control Panel->Java->Java Runtime Environment Settings but these had no effect.
How can I set JAVA_OPTS (and specially file.encoding property) globally in windows?
Thanks
解决方案
Did you try setting up environment variable JAVA_TOOL_OPTIONS ?
Set this to "-Dfile.encoding=UTF8" and it is supposed to be picked up by jvm. But if it doesn't, you are left with no choice other than to use command line parameter.