일단 JVM 버전 변경 - 이건 진짜 웬만하면 자동으로 잡힌다.

  1. [File] - [Project Structure] - [Project] - [Project SDK] 변경

  2. [File] - [Project Structure] - [Project] - [Project language level] 변경

  3. [File] - [Project Structure] - [Module] - [Sources] - [Language level] 변경

  4. [File] - [Project Structure] - [Module] - [Dependencies] - [Language level] 변경

  5. [Preferences] - [Build, Execution, Deployment] - [Compiler] - [Java Compiler] - [Project bytecode version] 변경

  6. [Edit configurations] - [Environment] - [JRE] 변경 : 이 부분은 default로 변경하면 알아서 맞춰진다.

Gradle JVM 변경

[Preferences] - [Build, Execution, Deployment] - [Build Tools] - [Gradle] - [Gradle JVM] 변경

만약에 Maven으로 위와 같은 오류가 났다면 Gradle JVM 변경한 것처럼 [Build Tools] - [Maven] 에서 관련된 JVM/JRE 버전을 맞춰주면 될 것 같다.

출처 : https://binux.tistory.com/92