Today, a helloworld.java source file is created by using the Echo instruction of the windows command line. The following errors are reported when compiling into a bytecode file:
Cause and solution: when javac compiles the source file, it needs to decode the source file. By default, the character encoding of the operating system is used for decoding. The simplified version of win11 uses GBK, so pay attention to whether GBK is used when encoding the source file. If there is only English, the encoding method of the source file is only compatible with ASCII code. Or you can change the character encoding during decoding through the command parameters of javac.
Similar Posts:
- Javac reports error wakeonlan. Java: 19: error: unmapped character encoding GBK
- After the JVM is started, setting the system property file.encoding again cannot affect the default encoding of the system & sun.jnu.encoding
- Transcoding of system.web.httputility.urlencode in C #
- UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-1:
- Non-ASCII character ‘\xe8’ in file xxx.py on line 8, but no encoding declared
- [Solved] Python Numpy Data load error: Unicode error: unpicking a python object failed: Unicode decodeerror
- The solution of job failed to start when modifying MySQL character encoding
- SyntaxError: Non-ASCII character ‘\xe2‘ in file
- Java : Character decoding failed [How to Solve]
- node env: node\r: No such file or directory