BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

2025. 1. 18. 06:26·개발/java

증상

BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

 

원인

  • JDK 와 Gradle 버전 호환 문제

버전확인

PS D:\> gradle -v

------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          21.0.5 (Amazon.com Inc. 21.0.5+11-LTS)
OS:           Windows 11 10.0 amd64

PS D:\> java --version
openjdk 21.0.5 2024-10-15 LTS
OpenJDK Runtime Environment Corretto-21.0.5.11.1 (build 21.0.5+11-LTS)
OpenJDK 64-Bit Server VM Corretto-21.0.5.11.1 (build 21.0.5+11-LTS, mixed mode, sharing)

해결

호환성확인 

Java LTS

Java version Support for toolchains Support for running Gradle
8 N/A 2.0
11 N/A 5.0
17 7.3 7.3
21 8.4 8.5

 

Java LTS support Gradle과 대응되는 Kotlin

Embedded Kotlin version Minimum Gradle version Kotlin Language version
1.3.10 5.0 1.3
1.5.31 7.3 1.4
1.9.20 8.5 1.8

 

확인

PS D:\> gradle -v

Welcome to Gradle 8.5!

Here are the highlights of this release:
 - Support for running on Java 21
 - Faster first use with Kotlin DSL
 - Improved error and warning messages

For more details see https://docs.gradle.org/8.5/release-notes.html


------------------------------------------------------------
Gradle 8.5
------------------------------------------------------------

Build time:   2023-11-29 14:08:57 UTC
Revision:     28aca86a7180baa17117e0e5ba01d8ea9feca598

Kotlin:       1.9.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          21.0.5 (Amazon.com Inc. 21.0.5+11-LTS)
OS:           Windows 11 10.0 amd64

PS D:\test> gradle build
Starting a Gradle Daemon, 4 incompatible Daemons could not be reused, use --status for details

> Task :buildEnvironment

------------------------------------------------------------
Root project 'test'
------------------------------------------------------------

classpath
No dependencies

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed

 

https://docs.gradle.org/current/userguide/compatibility.html

 

Compatibility Matrix

Gradle runs on the Java Virtual Machine (JVM), which is often provided by either a JDK or JRE. A JVM version between 8 and 23 is required to execute Gradle. JVM 24 and later versions are not yet supported. Executing the Gradle daemon with JVM 16 or earlier

docs.gradle.org

 

728x90

'개발 > java' 카테고리의 다른 글

jib  (2) 2024.12.26
openjdk 12 ~ 21 feature  (3) 2024.11.15
spring cloud task  (1) 2024.11.14
jasypt  (1) 2024.11.13
@Aspect로 공통header 처리  (2) 2024.02.19
'개발/java' 카테고리의 다른 글
  • jib
  • openjdk 12 ~ 21 feature
  • spring cloud task
  • jasypt
yunapapa
yunapapa
working on the cloud
    250x250
  • yunapapa
    supermoon
    yunapapa
  • 전체
    오늘
    어제
    • 분류 전체보기 (94)
      • 개발 (20)
        • java (17)
        • web (2)
        • MSX (1)
        • Go (0)
      • CloudNative (50)
        • App Definition & Developeme.. (17)
        • Orchestration & Management (4)
        • Runtime (3)
        • Provisioning (7)
        • Observability & Analysis (14)
        • event review (5)
      • AWS (7)
      • 환경관련 (17)
      • 취미생활 (0)
        • 맛집 (0)
        • 게임 (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • CNCF Past Events
    • Kubernetes Korea Group
  • 공지사항

  • 인기 글

  • 태그

    AWS
    OpenShift
    Pinpoint
    오블완
    k8s
    devops
    Java
    gitlab
    istio
    dop-c02
    springboot
    티스토리챌린지
    APM
    helm
    kubernetes
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
yunapapa
BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65
상단으로

티스토리툴바