如何设置java keytool的默认语言? [英] How to set default language for java keytool?
问题描述
我使用带有英语和美式键盘设置的Windows操作系统。我使用此命令生成密钥库。它工作正常。
I use Windows OS with English language and US keyboard setting. I use this command to generate keystore. It works fine.
C:\java6\jre\bin\keytool -genkey -keyalg RSA -alias mykey -validity 3652 -keystore C:\mykeystore -storepass 111111111 < data.txt
data.txt
My name
My org unit
My org
My city
My state
ch
yes
但是,在具有德语和键盘设置的Windows上,此程序无法正常工作。我必须在data.txt中将是更改为 ja 以使其有效。
However, this program cannot work normally on Windows with German language and keyboard setting. I must change the word "yes"" to "ja" in data.txt to make it works.
修改data.txt是不错的。
It isn't good to modify the data.txt.
有没有办法将英语设为keytool的默认语言?
Is there any way to set English as default language for keytool?
推荐答案
简而言之,您必须将 -Duser.language = en
选项传递给Java机器。我知道有两种方法:
In a nutshell you must pass the -Duser.language=en
option to the Java machine. I know of two ways to do this:
-
只需一次调用,指定
-J-Duser。
选项,例如keytool
命令行中的language = en
For just one invocation, specify the
-J-Duser.language=en
option on thekeytool
command line, e.g.
keytool -J-Duser.language=en -genkey -keyalg RSA -alias mykey -validity 3652 -keystore C:\mykeystore -storepass 111111111 < data.txt
另请参阅 SO:强制在JDK7中使用英语工具
要全局更改Java语言,请设置 JAVA_TOOL_OPTIONS
环境变量le具有 -Duser.language = en
值。
To change Java language globally, set the JAVA_TOOL_OPTIONS
environment variable to have the -Duser.language=en
value.
这篇关于如何设置java keytool的默认语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!