当前位置:网站首页>idea 的 gradle项目中文乱码
idea 的 gradle项目中文乱码
2022-07-23 01:45:00 【猎人在吃肉】
1、idea 配置
打开 idea ,File-> Settings-> File Encodings

2、配置 build.gradle
在项目的 build.gradle 中添加如下内容:
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
整个项目要重新编译才能生效。
每个Gradle项目都需要插入一段代码,很麻烦 ?!
3、 win10 环境变量配置
每个Gradle项目都需要插入一段代码,很麻烦。还有一种一劳永逸办法,就是环境变量指定编码。
GRADLE_OPTS=-Dfile.encoding=utf-8

idea 和 控制台要重启,才能生效。
4、idea64.exe.vmoptions 配置
4.1、方法1
打开 idea ,Help -> Edit Custom VM Options

在打开的 idea64.exe.vmoptions 中添加如下内容:
-Dfile.encoding=UTF-8
说明:一般情况下, idea64.exe.vmoptions 在 C:\Users\admin\AppData\Roaming\JetBrains\IntelliJIdea版本号 目录下。
4.2、方法2
idea 安装目录, C:\Program Files\JetBrains\IntelliJ IDEA 版本号\bin 路径下,找到 idea64.exe.vmoptions 配置。
在 idea64.exe.vmoptions 中添加如下内容:
-Dfile.encoding=UTF-8
4.3、方法3
上面的 4.1 、 4.2 中的 idea64.exe.vmoptions , 不是 idea 实际使用的配置文件, 实际使用的配置文件 在其他位置。
比如,

在 idea.vmoptions 中添加:
-Dfile.encoding=UTF-8
边栏推荐
猜你喜欢

作物叶片病害识别系统

事件侦听和删除事件——event对象——默认事件——取消冒泡事件——事件委托——默认触发

LEADTOOLS 20-22 Crack-DotNetCore!!!

复盘:一副牌(54张),三人斗地主,大小王在同一家的概率是多少

The new regulation issued the first construction certificate, and the gold content of highway and water conservancy specialty increased

MongoDB的CRUD操作(2)

使用递归字符串反转和全排列

QML(17)——读写txt文件

Installation, configuration and use of sentry

xmpp 服务研究(一)
随机推荐
Developers must see | devweekly issue 1: what is time complexity?
35岁程序员,早到的中年危机
Déterminer s'il s'agit d'un type vide
1057 Stack
[SSM]异常处理
向后量子密码学迁移!美国NIST公布12家合作伙伴
Self assignment and abnormal security problems in operator=
复盘:什么是B+树?你知道B+树怎么构建有序表的吗?B+树有什么特点
Is it safe to apply for a stock trading account and open an account on your mobile phone?
Blog milestones
Vs Code shortcut key settings
【Jailhouse 文章】Virtualization over Multiprocessor System-on-Chip an Enabling Paradigm for...
pna肽核酸定制服务|肽核酸钳制-PCR(PNA-PCR)|cGAPPNA多价肽核酸配体
pytorch 保存和加载模型
The pit trodden by real people tells you to avoid the 10 mistakes often made in automated testing
【HLS】流水线仿真之排队函数的调用
Canal Chapter 5
Adas test plan
Keyword Driven
AIRIOT答疑第5期|如何使用低代码业务流引擎?