1

My default language is Chinese and that makes debug very hard.

I know there is a lot of similar questions here, but I have no prior knowledge of working with JVM or command line setup of java, I tried to copy their command to my terminal and that does not work at all.

Could someone just provide me a line of code that change the language of java compiler? Thanks a lot.

Tony
  • 39
  • 6
  • Can this help? https://stackoverflow.com/questions/8809098/how-do-i-set-the-default-locale-for-my-jvm – Kelvin Ho Nov 25 '19 at 02:12
  • *"change the language of java **compiler**"* Are you asking how to get compiler error messages in another language? – Andreas Nov 25 '19 at 02:30
  • Does `javac` produce localized error messages? I don’t think so. And “debug” doesn’t imply compiler error messages anyway. So which debugger are we talking about? – Holger Nov 25 '19 at 09:15
  • @KelvinHo not really it still does not specify what to do, it may assume I have already known about setting up java through command line option, but I did not know。 – Tony Dec 02 '19 at 06:03
  • @Andreas Yes, now the complier displays error message in chinese which is not so helpful. – Tony Dec 02 '19 at 06:04
  • @Holger what I mean is that currently I cannot understand the Chinese version of the error message and It makes debugging process hard in the sense I cannot even use google to google the error message. – Tony Dec 02 '19 at 06:06
  • @Tony but what error message are you talking about? A message from the compiler, as your question says, or rather a message from the JVM or even your own application? – Holger Dec 02 '19 at 10:09

1 Answers1

1

You can set the the default locale of the JVM by passing the following system properties:

-Duser.language=en -Duser.country=US

Kelvin Ho
  • 376
  • 2
  • 3
  • 14
  • how may I pass this command? using terminal or what, sorry I have no idea how to set this relate to JVM. – Tony Dec 02 '19 at 06:01
  • Do you use any IDE or just run the program in the command prompt? If you just run in the command prompt, you can just run like this: java -Duser.language=en -Duser.country=US package.name.ClassName – Kelvin Ho Dec 02 '19 at 23:32