简体   繁体   中英

Running java in Windows cmd with all question marks

C:\Users\yanglu>javac
??: javac <options> <source files>
??, ???????:
  -g                         ????????
  -g:none                    ?????????
  -g:{lines,vars,source}     ?????????
  -nowarn                    ???????
  -verbose                   ?????????????????
  -deprecation               ???????? API ????
  -classpath <??>            ???????????????????
  -cp <??>                   ???????????????????
  -sourcepath <??>           ????????????
  -bootclasspath <??>        ??????????
  -extdirs <??>              ??????????
  -endorseddirs <??>         ????????????
  -proc:{none,only}          ???????????/????
  -processor <class1>[,<class2>,<class3>...] ?????????????; ?????????
  -processorpath <??>        ?????????????
  -parameters                ???????????????
  -d <??>                    ?????????????
  -s <??>                    ?????????????
  -h <??>                    ????????????????
  -implicit:{none,class}     ????????????????
  -encoding <??>             ????????????
  -source <???>              ?????????????
  -target <???>              ???? VM ??????
  -profile <????>            ?????? API ???????????
  -version                   ????
  -help                      ?????????
  -A???[=?]                  ????????????
  -X                         ??????????
  -J<??>                     ??? <??> ????????
  -Werror                    ?????????
  @<???>                     ???????????

The default language of my PC is English. Can anyone tell me how to solve that?

Looks like Java is picking up an Asian language as the default and Windows can't display it. Not sure why exactly, but you can get Javac to temporarily use US English language by using:

javac -J-Duser.language=en -J-Duser.country=US <other arguments>

All the advice given is good advice:

1) If you're sure your PC is English - then it sounds like your JDK isn't. Consider getting a known-English JDK and installing it instead.

2) Try the chcp 437 command,

... or ...

3) Failing all else, try the magic java -Duser.language=en -Duser.country=US incantation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM