Sau*_*uri 1 java compilation ubuntu-16.04
在ubuntu中编译Java代码时遇到此错误。
Run Code Online (Sandbox Code Playgroud)error: illegal character: '\ufeff' import java.net.*; ^ error: class, interface, or enum expected import java.net.*; ^
Jef*_*eff 11
如果您使用的是 Windows 操作系统并使用 Eclipse(它没有从文件中删除 BOM 的功能),只需在 Notepad++ 中打开文件,然后在编码菜单中选择“UTF-8”,然后保存文件。
正如Jim Garrison所指出的,您可能在文件的开头有一个字节顺序标记(BOM)。使用可以查看所有不可打印字符并将其删除的编辑器。
或者,您可以使用sed将其删除:
sed '1s/^.//' infile >> outfile
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
8911 次 |
最近记录: |