The program error caused by IDEA's Chinese comments! 【solution】

Hello! I am the little gray ape! A programmer who can write bugs!

Recently, when I used IDEA to write a Java project, I encountered such a situation, that is, there is no problem with the code running before, and then I added a Chinese comment to the code the next day, and when I ran it again, I found that the program could not run normally. I checked the reason for the error because of the Chinese comments I added to the code. The error is like this:

After deleting the Chinese comment, the code will run again and there will be no problem. After changing the Chinese comment to the English comment, it can also run normally...

my God! This is the first time I have encountered a bug in the program due to Chinese and English comments! However, I am naturally beautiful in English. How can I change so many Chinese annotations into English?

Then I searched for related solutions on the Internet, but found that it was not what I wanted. Finally, it was speculated that it should be caused by the encoding problem of the operating environment, and then the problem was solved after the environment encoding of IDEA was changed to UTF-8.

The solution steps are as follows:

Open IDEA file—>Settings—>Compiler—>File encoding

After that, just set the encoding to UTF-8, my side is UTF-8 encoding, and then reset it.

The details are as follows:

 

Guess you like

Origin blog.csdn.net/weixin_44985880/article/details/109678682