1、idea控制台乱码解决

(1)
idea乱码打开idea的安装的bin目录,找到上图的两个文件(根据你的系统是32位或64位选择其中一个配置文件),在配置文件中添加:

-Dfile.encoding=UTF-8

(2)配置项目启动服务器参数,在Tomcat配置中
在VM options项中添加: -Dfile.encoding=UTF-8
idea乱码(3)配置项目编码及IDE编码
idea乱码#### 2、.对于maven构建的项目,由于idea中maven的配置优先,需要在pom.xml中对maven-surefire-plugin进行配置。(还没有试过)

   <plugins>

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-surefire-plugin</artifactId>

        <version>2.12.4</version>

        <configuration>

          <forkMode>once</forkMode>

          <argLine>-Dfile.encoding=UTF-8</argLine>

        </configuration>

      </plugin>

    </plugins>

相关文章:

  • 2021-06-11
  • 2021-10-27
  • 2021-06-16
  • 2021-08-05
  • 2021-11-05
  • 2021-08-16
猜你喜欢
  • 2021-08-03
  • 2021-08-08
  • 2021-11-26
  • 2021-12-28
  • 2021-07-29
  • 2021-09-06
相关资源
相似解决方案