the problem
When opening the eclipse java project compiling with IDEA, the following error occurred:
Error:(1, 1) java: Illegal character: ‘\ufeff’
Error:(1, 10) java: need class, interface or enum
2. Reason analysis
Eclipse can intelligently convert UTF-8+BOM files into ordinary UTF-8 files. IDEA does not have this intelligent conversion.
Three, the solution
1 Convert with IDEA, first convert to GBK, and then back to UTF-8
2 Convert with other editors, such as notpade++, sublime, etc.
The principle is the same, the operation is omitted.
Read More:
- [Solved] error converting to execution character set illegal byte sequence
- [Solved] Hive tez due to: ROOT_INPUT_INIT_FAILURE java.lang.IllegalArgumentException: Illegal Capacity: -38297
- [Solved] Springboot WARNING: All illegal access operations will be denied in a future release
- [Solved] tasm Error: illegal memory reference
- [Solved] Illegal access: this web application instance has been stopped already
- [Solved] jetson nano Error: Illegal instruction(core dumped)
- [Solved] std::max() error C2589: ‘(‘ : illegal token on right side of ‘::‘
- How to Solve ES error: “illegal_argument_exception”
- [Solved] Vscode1.71.0 terminal error: `sed: illegal option — r`
- Implement base64_decode in GO language to solve the problem of illegal characters
- .sh error: ***.sh: 2: set: Illegal option – Solution
- [Solved] Docker Error: SyntaxError: Non-ASCII character ‘\xe5‘ in file xxx
- [Solved] Console error: syntax error: illegal return statement
- [Solved] hello.s:15 Error: junk at end of line, first unrecognized character valued 0x8
- TensorRT model quantization error: Error Code 1: Cuda Runtime (an illegal memory access was encountered)
- FTP 500 Illegal PORT command. ftp: bind: Address already in use [How to Solve]
- [Solved] SyntaxError:JSON.parse:unexpected character at line 1 column 1 of the JSON data
- IntelliJ Error: unsescaped XML character [How to Solve]
- [Solved] JSON parse error: Unexpected character (‘‘‘ (code 39)): was expecting double-quote to star
- [Solved] JSON parse error: Unexpected character (‘‘‘ (code 39)): was expecting double-quote to start ……