tags:

views:

42

answers:

2

When issue the command "javac" on the terminal of mac,the java help document is garbled.

zhang-zhongdemacbook:~ zhangzhong$ javac
?÷???javac <ѡ??> <Դ?ļ?>
???У????ܵ?ѡ???????
  -g                         ???????е?????Ϣ
  -g:none                    ???????κε?????Ϣ

zhang-zhongdemacbook:~ zhangzhong$ javac -version
javac 1.6.0_13
zhang-zhongdemacbook:~ zhangzhong$ java -version
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)
zhang-zhongdemacbook:~ zhangzhong$ set
LANG=zh_CN.UTF-8

Could you help me on the issue?

+1  A: 

I guess it has something to do with your Terminal.app-wide Locale settings. This guy (http://www.rift.dk/news.php?item.7.6) reckons:

One of the first things you'll notice when typing an international character in Terminal.app, such as æ, ü, é or whatever, is that it will show up as ae, u and e respectively. This is no good. Make sure Terminal.app is configured correctly, go to its "Window settings..." and make sure that "Wide glyphs for Japanese.." is checked and that Character Set Encoding is set to "Unicode (UTF-8)".

He also recommends to install a newer version of bash (through Macports or fink) and register the newer version as the default shell.

Lenni
+1  A: 

Your terminal does not correctly interpret the output from javac, which is most likely an encoding issue.

Be sure that any locale variable ("export" in Terminal.app) corresponds to the encoding expected by Terminal.app (check Settings, I'm not at a Mac right now). If all else fails, try "export LANG=" so plain English should be output.

Thorbjørn Ravn Andersen
Yes: Terminal > Preferences > Encodings; Check all that apply.
trashgod