[Intellij / 인텔리제이] 윈도우 실행시 한글 깨짐
개발 유틸리티/intellij

[Intellij / 인텔리제이] 윈도우 실행시 한글 깨짐

1. 콘솔에 System.out.println 한글 깨짐

System.out.println("PathVariable : " + pathName);

 

2. 테스트코드에 @DisplayName 한글 깨짐

public class Test1 {
    @DisplayName("1. 테스트")
    @Test
    void test_1(){
        assertEquals("test", "test");
    }
}

 

3. 해결 방법

  1. File > Setting > File EncodingsUTF-8로 수정
  2. C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.3\bin (디폴트 경로) 설치 경로에 idea.exe.vmoptions, idea64.exe.vmoptions 파일 수정
    파일 맨 아랫줄에 아래와 같이 입력
    
    -Dfile.encoding=UTF-8
  3. help > Edit Custom Vm Options 수정
    파일 맨 아랫줄에 아래와 같이 입력
    
    -Dfile.encoding=UTF-8
  4. File > Setting > Build Tools > Gradle 에 Build and run using, Run tests using Intellij로 수정
    Gradle 설정을 하지 않는 경우 아래와 같은 오류가 발생
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
    Use '--warning-mode all' to show the individual deprecation warnings.

 

 

4. 정상 동작 화면

 

출처:
https://alwaysbemoon.tistory.com/120

https://onlyfor-me-blog.tistory.com/248