abstractIn this paper, four methods are summarized to solve the Chinese garbled problem of IntelliJ idea console perfectly.
If IntelliJ idea is not configured, the problem of Chinese garbled code in the console will be very serious, which will seriously affect our access to information and program tracking. This paper summarizes the following four points to solve the problem of Chinese garbled on the console, hoping to help you.
be carefulAccording to the summary of my daily work experience, the order is the order we need to pay attention to. After each modificationBe sure to restart IntelliJ idea for the configuration to take effect。
1、 Modify the virtual machine output options of the current web project Tomcat server
Top navigation bar “run → edit configurations…” Enter the configuration page, modify the virtual machine output option VM options of the current web project Tomcat server, and add it- Dfile.encoding=UTF -8 。 After restart, run the program to check the console information. If it doesn’t work, please perform the following steps.
2、 Modify IntelliJ idea global code, project code and attribute file code
Top navigation bar “file → settings…” Enter the configuration page, slide down to “file encodings” in “editor”, and set global encoding, project encoding and default encoding for properties files to UTF-8 respectively. After restart, run the program to check the console information. If it doesn’t work, please perform the following steps.
3、 Custom virtual machine options in IntelliJ idea
Top navigation bar “help → etit custom VM options…” Enter the custom virtual machine options page.
In idea 64 exe.vmoptions Add at the end of the file- Dfile.encoding=UTF -8。 After restarting, run the program to check the console information. Generally, the problem is solved at this step. Of course, if it doesn’t work, please perform the following stepsSuper step。
4、 Directly modify the encoding information of IntelliJ idea configuration file
We open the local installation directory of IntelliJ idea, find the following two files, open them with Notepad, and add them on the last line- Dfile.encoding=UTF -8. After the restart, run the program to check the console information, the problem is solved!
5、 Code modified successfully
Through the above four ways, we can completely modify the Chinese garbled problem we encountered in IntelliJ idea console.
In this paper, I summarize four methods to solve the problem of Chinese garbled code in IntelliJ idea console perfectly. Once again, after each modification, be sure to restart IntelliJ idea to make the configuration take effect. Good tools to use!
This article is a summary of four ways to solve the problem of Chinese garbled code on IntelliJ idea console in Huawei cloud community, written by Bai Lu.