Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting default locale for Tomcat Service in Windows XP

I have installed Apache Tomcat 6 as a Service in a Windows XP computer (French)

My problem is that Tomcat itself and all webapps (Sonar and Hudson) now show french messages. I want English messages of course so I went to the "Regional Settings" window in Control panel and changed everything to English (US)

Tomcat however is still in French. Nothing changed at all.

I suspect that because it runs as a service it does not pick the settings from control panel.

So is there any way to trick the Tomcat JVM so that it uses English instead of French? I have sys admin access to the machine (XP PRO French)

Thank you

like image 273
kazanaki Avatar asked Jul 20 '09 13:07

kazanaki


People also ask

Where is Tomcat home directory Windows?

It can be found on the local filesystem at: $CATALINA_HOME/webapps/ROOT/index. html where "$CATALINA_HOME" is the root of the Tomcat installation directory.

Where is Tomcat JVM settings?

When running Apache Tomcat as a service on Windows, the JVM settings are stored in the Registry Editor at HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\. This location contains a directory for either Tomcat 6, Tomcat 7 or Tomcat 8, which maintains a list of the parameters that can be configured.


4 Answers

You need to set user.language and user.region appropriately,

e.g.

java -Duser.language=en -Duser.region=CA

in your Tomcat startup (probably catalina.bat). Check this link for more info, and for references to the sets of valid ISO codes for the above.

like image 131
Brian Agnew Avatar answered Sep 28 '22 15:09

Brian Agnew


The Tomcat manager was showing up in French for me, despite the fact that I tried some of the suggestions above. The issue turned out to be browser specific. Chrome had "French" listed as one of my languages and as soon as I removed it from the list in preferences and refreshed the page, Tomcat showed up in English. I hope that will be helpful for anybody else in the future who is having this sort of problem.

like image 45
jdussault Avatar answered Sep 28 '22 15:09

jdussault


Specify language option in service parameters.

$Tomcat/bin/javaw.exe move to Java tab and specify -Duser.language=en -Duser.region=CA at Java Options:

like image 36
Rudy Avatar answered Sep 28 '22 16:09

Rudy


Regional Settings are per user and services are run as a different user (which one is used for each service can be checked in Control Panel / Administrative Tools / Services ).

So you changed the settings for the user account you used to log in, while the Tomcat service is run under a different account.

like image 37
David Balažic Avatar answered Sep 28 '22 16:09

David Balažic