tags:

views:

4250

answers:

5

When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale?

+3  A: 

You could call during init or whatever Locale.setDefault() or -Duser.language=, -Duser.country=, and -Duser.variant= at the command line. Here's something on Sun's site.

sblundy
+2  A: 

I believe java gleans this from the environment variables in which it was launched, so you'll need to make sure your LANG and LC_* environment variables are set appropriately.

The locale manpage has full info on said environment variables.

pjz
What are the LC_* environment variables ?
Leonel
A: 

One way to control the locale settings is to set the java system properties user.language and user.region.

killdash10
+2  A: 

With the user.language, user.country and user.variant properties.

Example:

java -Duser.language=th -Duser.country=TH -Duser.variant=TH SomeClass

broady
A: 

If you are on Mac, simply using System Preferences -> Languages and dragging the language to test to top (before English) will make sure the next time you open the App, the right locale is tried!!

Gmu