Java 7 default locale

后端 未结 7 1678
忘了有多久
忘了有多久 2020-11-28 11:25

I have just installed jre7 and I\'m surprised to see that my default locale is now en_US. With jre6 it was de_CH.

What is different with jre7? Is the default locale

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 11:45

    If you are brave enough you can call the :

    Locale.setDefault(Locale.getDefault());
    

    This sets the default Locale for both of those categories

    public static synchronized void setDefault(Locale newLocale) {
       setDefault(Category.DISPLAY, newLocale);
       setDefault(Category.FORMAT, newLocale);
       defaultLocale = newLocale;
    }
    

    But this of course could cause side effects.

提交回复
热议问题