It should be noted that the "user.language" and "user.country" values need to be passed as VM Arguments at startup and NOT set using System.setProperty() at runtime, since System.setProperty() will not influence the default locale that is already in memory. If you need to change the default locale during runtime, use Locale.setDefault();
// THIS WON'T WORK - IF YOU NEED TO SET DEFAULT LOCALE AT RUNTIME, USE Locale.setDefault() System.setProperty("user.language","MY"); System.setProperty("user.country","IN");
Set Locale first and change the system propery
Locale.setDefault( new Locale("MY")); System.setProperty("user.language","MY"); Locale.setDefault( new Locale("IN") ); System.setProperty("user.language","IN");
Reference: http://www.avajava.com/tutorials/lessons/how-do-i-set-the-default-locale-via-system-properties.html