How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
问题描述
我正在寻找一组命令行参数,这些参数允许我为 Java 应用程序强制执行一组特定的语言环境设置.
I'm looking for a set of command line parameters that will allow me to force a specific set of locale settings for a java application.
假设我无法修改应用程序,所以我必须使用 java -Dmy.prop="value" 设置属性.
Let's say that I'm not able to modify the application, so I have to set the properties using java -Dmy.prop="value".
我特别希望更改日期/时间格式以使其符合 ISO-8601(军用时间),但我找不到合适的属性.
I'm looking specially to change the date/time format to make it ISO-8601 compliant (military time), but I was not able to find the proper properties for this.
推荐答案
很好,我对同样的事情感兴趣,但到目前为止我只有一个部分解决方案:
Nice, i was interested about the same thing but so far I have only a partial solution:
user.timezone=UTC
user.country=CA
user.variant=
user.language=en
file.encoding=utf8
您可以使用加拿大,因为它是使用 ISO 8601 格式的国家之一.
You can use Canada, because it one of the countries using the ISO 8601 format.
这篇关于如何更改 Java 中的默认语言环境设置以使其保持一致?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何更改 Java 中的默认语言环境设置以使其保持一致?
基础教程推荐
- Struts2 URL 无法访问 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
