IDEA解決控制台輸出中文亂碼方法


解決步驟

第一步:apache-tomcat-8.5.59\conf下的logging.properties

把java.util.logging.ConsoleHandler.encoding = UTF-8 修改為java.util.logging.ConsoleHandler.encoding = GBK
在這里插入圖片描述

第二步:設置IDEA的編碼

File>Setting>Editor>File Encodings,
將Global Encoding、Project Encoding、Default encodeing for properties files
這三項都設置成UTF-8,點擊OK或者Apply
在這里插入圖片描述

第三步:修改IntelliJ IDEA本地安裝目錄中bin文件夾下的idea.exe.vmoptions和idea64.exe.vmoptions這兩個文件

在最后一行加入-Dfile.encoding=UTF-8
在這里插入圖片描述

第四步:打開tomcat配置頁面,Edit Configurations

在VM options 中填寫-Dfile.encoding=UTF-8
在這里插入圖片描述

  轉載:https://blog.csdn.net/weixin_43532346/article/details/109045514


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM