Sunday, September 8, 2024
Hometomcat Solve the garbled problem of Tomcat in the IDEA console, detailed...

[Solved] Solve the garbled problem of Tomcat in the IDEA console, detailed nanny-level tutorial! (1)

Option One:
one、tomcat—->Edit Configurations

  1. Select Startup/Connection—->check Pass environment variables—->click the + sign

  1. Fill in: Name:JAVA_TOOL_OPTIONS; Value:-Dfile.encoding=UTF-8; Click Apply

  1. Select Server—->fill in -Dfile.encoding=UTF-8 in VM options—->click Apply; restart tomcat to see if the problem is successfully solved.

Option II:
1. Modify the garbled encoding of the editor. This is easy to solve. Change all of them into UTF-8. The path is file->settings->editor->file Encodings.

  1. Solve console garbled code
    Add -Dfile.encoding=UTF-8 in tomcat->Edit Configurations->VM options

  1. Operating environment
    existtomcat->Edit Configurations->Startup/Connection
    -—>Tick Pass environment variables—->Click the + sign
    Add the following code:
    JAVA_OPTS -Dfile.encoding=UTF-8
    JAVA_TOOL_OPTIONS -Dfile.encoding=UTF-8

In our local debugging, we usually choose debug directly.

  1. Change the encoding.xml under the .idea folder of the project
    Change all encoding formats inside to UTF-8

  1. Modify the two configuration files in the bin directory of the idea installation directory.
    Find the two files in the bin directory of the idea installation directory as shown below: 1.idea.exe.vmoptions 2.idea64.exe.vmoptions. Open them with an editor and add -Dfile.encoding=UTF-8 at the end of the file.

The last step is to restart idea, restart tomcat, and the problem should be solved!

RELATED ARTICLES

Most Popular

Recent Comments