"Error: Unmapped character encoding GBK" solution

When using javac to compile Java source code, if the code contains Chinese, regardless of whether the Chinese appears in a comment or a string constant, the following error may occur:
Insert picture description here
This is because javac cannot handle Chinese characters. At this time, just specify the decoding method. It can be UTF-8:

javac -encoding UTF-8 .\Imessage.java

Pay attention to the public account and receive more articles from me in the first time
Insert picture description here

Guess you like

Origin blog.csdn.net/vxzhg/article/details/97132363