Share on Facebook0Tweet about this on TwitterShare on Reddit0Share on Google+2Share on LinkedIn0Share on StumbleUpon0Buffer this pageEmail this to someonePrint this page

apache_tomcatIf for whatever reason you want to set the locale in Tomcat you simply need to add two jvm arguments in the catalina.sh file found in the bin directory of the Tomcat installation. I was able to set the default locale for Tomcat to US/en on a Mac running Mac OS X Leopard with Tomcat 7.0.8 installed. These instructions should work for any *nix machine as well as later versions of Tomcat, but I can’t guarantee it. If you’re using Windows, these instructions are probably also relevant, but you would change the catalina.bat file instead.

Step 1: Open catalina.sh

Find the file called catalina.sh in the bin folder of the Tomcat installation with any text editor.

Step 2: Find JAVA_OPTS=

Search for JAVA_OPTS= in the file and in particular locate the following lines of code:

Step 3: Append the Locale JVM properties

At the end of the JAVA_OPTS definitions add -Duser.language=en -Duser.region=US. You can of course chose any available locale and region settings you need and not just US/en.

Step 4: Save and Restart

Save the file and restart Tomcat.

Share on Facebook0Tweet about this on TwitterShare on Reddit0Share on Google+2Share on LinkedIn0Share on StumbleUpon0Buffer this pageEmail this to someonePrint this page

Related Posts

Subscribe To Our Newsletter

Join our low volume mailing list to receive the latest news and updates from our team.

Leave a Comment

Newsletter

Subscribe to our low-volume mailing list to receive important updates and announcements directly in your inbox.