Mowday, Xiaoming received the task from his superior and needed to develop a Gradle project in IDEA. When writing the test case, the following error occurred
2. The environment is as follows:
The IDEA 2019.3 Gradle 5.2.1 Java 1.8.0 comes with
3. Try the following
In the IDEA menu File==> Settings==> Edit==> Various UTF-8 are set in File Encoding. No effect. is also configured with UTF-8 in Gradle RunConfigurations. Still no effect of
Gradle and Gradle. Bat both join set DEFAULT_JVM_OPTS=” -dfile.Encoding =UTF-8″. Still not encoding!!
4. Final solution
Edit Help | Edit Custom VM Options in IDEA, adding the following parameters
-Dfile.encoding=UTF-8
The effect is as follows, problem solved
conclusion
In the emergence of Chinese disorderly code problem. The first time I thought of the coding format.
A compilation error occurred during gradle execution. Chinese encoding and IDEA encoding are inconsistent. Therefore, ensuring consistent encoding of the encoding file and IDEA is the key to solving the problem.
In CUSTOMER VM option in IDEA, the file encoding can be customized as UTF-8.
Read More:
- Solve the problem of using logback console to print log Chinese characters in IDEA as garbled characters
- Solve the problem of Chinese garbled code of actibpm plug-in in idea
- Solving the problem of Chinese garbled code in qtring
- The problem of Chinese garbled data in MySQL
- Solution of Chinese display garbled code in Git Bash
- After Oracle 11g is installed, SQL_ Plus.exe The problem of Chinese garbled in command window
- The use of Chinese characters in Qt and the solution to the “error C2001: newline in constant” problem
- Python – [encoding] in Python os.system Solution to Chinese garbled code when calling CMD command
- Solve the problem that data cannot be input in idea console
- Solution to garbled code problem after importing project in eclipse
- Resttemplate Chinese garbled problem – available
- Chinese garbled fonts in win10 English system
- Idea starts Tomcat console with garbled code but no error
- Solving Chinese garbled code in Java compressed file
- Solve the problem of Tomcat console and HTML garbled
- Solution to the problem of console flash in vs2017 runtime
- Solution of Chinese garbled code when using QT
- Anaconda Matplotlib drawing Chinese garbled solution
- The garbled problem of hot deployment in nginx
- Solution of MySQL data garbled problem