javac illegal character 65279


在使用 Ant compile files 的時候,
出現了的 illegal character: \65279 錯誤,


查看的結果,
原來是因為檔案存成Byte Order Mark is UTF-8(BOM),造成javac無法辨識。
使用HEX mode看,就可發現檔案開頭出現了一些特殊字元 (ex: EFBB)。


解決方法就是移除這些特殊字元,
也就是將檔案存成 UTF-8 檔首無BOM (Save the file in UTF-8 without BOM)。
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s