9

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.

olefevre
  • 4,097
  • 3
  • 23
  • 24

2 Answers2

6

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

Wolfgang
  • 2,367
  • 23
  • 29
  • 1
    To set it permanently for all users: `REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v JAVA_TOOL_OPTIONS /d -Duser.language=en /t REG_SZ /f` – mivk May 09 '13 at 14:26
3

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

Community
  • 1
  • 1
Anthony Accioly
  • 21,918
  • 9
  • 70
  • 118
  • Also take a look [here](http://www.java.com/en/download/help/locale.xml) if you want to change the system locale. – Anthony Accioly Jun 02 '11 at 16:54
  • As I said in the original post, javac error messages are in english, it is some of the help messages (e.g., from keytool) that give me trouble. In fact it seems that only keytool is affected. I'll try changing the system locale (which I mistakenly thought I had already switched to english) next time I am due for a reboot. – olefevre Jun 02 '11 at 17:33
  • By the way, AFAICT -J-Duser.language has no effect; e.g., javac -J-Duser.language=de still prints error messages in english, which is fine by me but if you wanted to change that apparently that wouldn't be the way. Perhaps it works in the other_language-to-english direction but I can't test that. – olefevre Jun 02 '11 at 17:40
  • @olefevre. Oh, sorry, I misread the question. See if setting the regional settings solve your problem. As for the flag, my system uses English by default, but running the command `javac -J-Duser.language=ja -help` prints the help in Japanese. Although I bet a lot of languages aren't supported. – Anthony Accioly Jun 02 '11 at 18:24
  • Yes, the presence of a register_ja.html file (and a chinese one, too) at the root of the JDK suggests that japanese may enjoy special support. – olefevre Jun 02 '11 at 21:29
  • I just rebooted after changing the locale to english and -J-Duser.language=en works now for keytool, also for many other languages (fr, es, it etc); I am pretty sure it did not work yesterday. By default it still uses german, though. – olefevre Jun 04 '11 at 10:28