<p>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?</p>

[{'answer_id': 64058, 'author': 'sblundy', 'author_id': 4893, 'author_profile': 'https://Stackoverflow.com/users/4893', 'pm_score': 4, 'selected': False, 'text': '<p>You could call during init or whatever <a href="http://java.sun.com/javase/6/docs/api/java/util/Locale.html#setDefault(java.util.Locale)" rel="noreferrer">Locale.setDefault()</a> or -Duser.language=, -Duser.country=, and -Duser.variant= at the command line. <a href="http://www.oracle.com/technetwork/articles/javase/locale-140624.html#using" rel="noreferrer">Here\'s something on Sun\'s site</a>.</p>\n'}, {'answer_id': 64064, 'author': 'pjz', 'author_id': 8002, 'author_profile': 'https://Stackoverflow.com/users/8002', 'pm_score': 5, 'selected': True, 'text': '<p>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.</p>\n\n<p>The locale <a href="http://linux.die.net/man/1/locale" rel="noreferrer">manpage</a> has full info on said environment variables.</p>\n'}, {'answer_id': 64070, 'author': 'killdash10', 'author_id': 7621, 'author_profile': 'https://Stackoverflow.com/users/7621', 'pm_score': 0, 'selected': False, 'text': '<p>One way to control the locale settings is to set the java system properties user.language and user.region.</p>\n'}, {'answer_id': 64096, 'author': 'Chris Broadfoot', 'author_id': 3947, 'author_profile': 'https://Stackoverflow.com/users/3947', 'pm_score': 6, 'selected': False, 'text': '<p>With the <code>user.language</code>, <code>user.country</code> and <code>user.variant</code> properties.</p>\n\n<p>Example:</p>\n\n<p><code>java -Duser.language=th -Duser.country=TH -Duser.variant=TH SomeClass</code></p>\n'}, {'answer_id': 2936833, 'author': 'Gmu', 'author_id': 252689, 'author_profile': 'https://Stackoverflow.com/users/252689', 'pm_score': 2, 'selected': False, 'text': '<p>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!! </p>\n'}, {'answer_id': 9894836, 'author': 'cayhorstmann', 'author_id': 375317, 'author_profile': 'https://Stackoverflow.com/users/375317', 'pm_score': 5, 'selected': False, 'text': '<p>I had to control this in a script that ran on a machine with French locale, but a specific Java program had to run with en_US. As already pointed out, the following works:</p>\n\n<pre><code>java -Duser.language=en -Duser.country=US ...\n</code></pre>\n\n<p>Alternatively, </p>\n\n<pre><code>LC_ALL=en_US.UTF-8 java ...\n</code></pre>\n\n<p>I prefer the latter.</p>\n'}, {'answer_id': 10646947, 'author': 'Derzu', 'author_id': 1178478, 'author_profile': 'https://Stackoverflow.com/users/1178478', 'pm_score': 2, 'selected': False, 'text': '<p>You can change on the console:</p>\n\n<pre><code>$ export LANG=en_US.utf8\n</code></pre>\n'}, {'answer_id': 24987464, 'author': 'hiroshi', 'author_id': 338986, 'author_profile': 'https://Stackoverflow.com/users/338986', 'pm_score': 4, 'selected': False, 'text': '<p>For tools like <code>jarsigner</code> which is implemented in Java.</p>\n\n<pre><code>JAVA_TOOL_OPTIONS=-Duser.language=en jarsigner\n</code></pre>\n'}, {'answer_id': 29652154, 'author': 'aseychell', 'author_id': 273673, 'author_profile': 'https://Stackoverflow.com/users/273673', 'pm_score': 1, 'selected': False, 'text': '<p>On linux, create file in <code>/etc/default/locale</code> with the following contents</p>\n\n<pre><code>LANG=en.utf8\n</code></pre>\n\n<p>and then use the <code>source</code> command to export this variable by running</p>\n\n<pre><code>source /etc/default/locale\n</code></pre>\n\n<p>The source command sets the variable permanently.</p>\n'}, {'answer_id': 55067828, 'author': 'Matthew Buckett', 'author_id': 244744, 'author_profile': 'https://Stackoverflow.com/users/244744', 'pm_score': 4, 'selected': False, 'text': "<p>If you ever want to check what locale or character set java is using this is built into the JVM:</p>\n\n<pre><code>java -XshowSettings -version\n</code></pre>\n\n<p>and it will dump out loads of the settings it's using. This way you can check your <code>LANG</code> and <code>LC_*</code> values are getting picked up correctly.</p>\n"}]
['https://Stackoverflow.com/questions/64038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']