How to change locale in a Windows terminal?

Weijun Wang weijun.wang at oracle.com
Wed Aug 10 02:52:25 UTC 2016


Hi Kris

Yes, it works, with -Duser.language.

Unfortunately, I am looking for a way to change the default/initial 
locale, and then using these system properties to change the effective 
locale again. :-)

Precisely, there is a test using grep to match warning messages and on a 
Chinese Windows it cannot find the hardcoded English text. Since I only 
have Windows in English, I need to a way to mimic a Chinese Windows 
first, and then see if adding -Duser.language=en -Duser.country=US to 
the test will make it work again.

On a Mac it's much easier.

Thanks
Max

On 8/10/2016 9:33, Krystal Mok wrote:
> Hi Max,
>
> Does setting -Duser.country=CN work for you? (I don't remember what the
> correct name for China should be, but setting that to US forces java to
> print the help message in English)
>
> - Kris
>
> On Tue, Aug 9, 2016 at 6:25 PM, Weijun Wang <weijun.wang at oracle.com
> <mailto:weijun.wang at oracle.com>> wrote:
>
>     My Windows 10 is English, but I want the java command to show
>     Chinese help screen temporarily.
>
>     I've tried "set LANG", chcp, "control intl.cpl,, /f:" but none works.
>
>     Thanks
>     Max
>
>


More information about the core-libs-dev mailing list