问题
I just installed JDK7 on a german Windows machine and the first thing I noticed is that unlike JDK6 it takes after the OS and some messages (e.g., the help messages from the tools but not error messages from the compiler) are in german. How can I force it to use english everywhere? AFAIK the installer isn't language-specific and all the messages during installation were in english.
回答1:
You mean javac?
Try setting -J-Duser.language=en
argument.
See this post: Passing "-J-Duser.language" into javac through ant to ensure compilation errors are reported in the correct language
回答2:
You can set default java options with the environment variable JAVA_TOOL_OPTIONS.
So, to change the language, set it to -Duser.language=en
Source
来源:https://stackoverflow.com/questions/6217297/forcing-the-use-of-english-in-jdk7-tools