By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,557 Members | 1,184 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,557 IT Pros & Developers. It's quick & easy.

Changing Java's regional setting

P: n/a
Is there a way to tell Java what localization to use so applications and
the compiler doesn't default to the system's setting? I'm using a
computer with Windows 2000 with a regional setting of Japanese. Is there
any way to have Java always use US English rather than the default Japanese?
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Grumfish wrote:
Is there a way to tell Java what localization to use so applications and
the compiler doesn't default to the system's setting? I'm using a
computer with Windows 2000 with a regional setting of Japanese. Is there
any way to have Java always use US English rather than the default
Japanese?


Locale.setDefault(Locale.US);

Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #2

P: n/a
i should bloody hope so....

http://developers.sun.com/techtopics/global/index.html

http://java.sun.com/developer/codesamples/int.html

- perry
Grumfish wrote:
Is there a way to tell Java what localization to use so applications and
the compiler doesn't default to the system's setting? I'm using a
computer with Windows 2000 with a regional setting of Japanese. Is there
any way to have Java always use US English rather than the default
Japanese?


Jul 17 '05 #3

P: n/a
Raymond DeCampo wrote:

Locale.setDefault(Locale.US);

Ray


This doesn't seem to do what I'm looking for. I checked the docs and
tried a quick program using it and it only seems to change the locale of
that single instance of the application. I would like a way so that
every Java application and the compiler defaults to using English rather
than the system's default locale. Something like a config file or
environment variable that is checked by every instance of Java before
checking the system's setting.
Jul 17 '05 #4

P: n/a
Grumfish wrote:
Raymond DeCampo wrote:

Locale.setDefault(Locale.US);

Ray


This doesn't seem to do what I'm looking for. I checked the docs and
tried a quick program using it and it only seems to change the locale of
that single instance of the application. I would like a way so that
every Java application and the compiler defaults to using English rather
than the system's default locale. Something like a config file or
environment variable that is checked by every instance of Java before
checking the system's setting.


So you want Java and it's tools to run as if the regional settings are
for US even though the OS settings are for Japanese? I don't think that
most programs would bother with adding such functionality; after all, if
the user has his or her regional settings set to something, that's
probably what they want.

I suppose you have some reason for not being able to change the regional
settings in Windows? This would be the most obvious solution.

In that case, I would explore OS-level solutions instead of expecting
the applications to provide this. In particular, I would set up a
second user on the machine with the default regional settings set to US.
Then I would use runas to launch all the programs I would like to
display as US locale. (Look at the runas documents carefully however,
it must be invoked in a particular way to pick up all of the target
user's configuration.)

Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.